interview-guide Docker & Self-Hosted Deployment

GitHub

An opinionated, actionable guide for software engineering interviews.

4,249 stars Astro 1 file · ~21,955 tokens #interview#interview-preparation#leetcode
RAW Compose
1. Pull Image (DOCKERHUB) docker pull pgvector/pgvector
2. Docker Run (1-Click Launch) docker run -d --name interview-guide -p 5432:5432 --restart always pgvector/pgvector:pg16
3. Podman Run podman run -d --name interview-guide -p 5432:5432 --restart always pgvector/pgvector:pg16
4. Skopeo Inspect (Zero-Pull Manifest) skopeo inspect docker://docker.io/pgvector/pgvector:pg16
5. ORAS Pull (OCI Artifact) oras pull pgvector/pgvector:pg16
6. Compose Deployment docker compose up -d
docker-compose.dev.yml
Download .yml
# 本地开发依赖服务
# 用法:docker compose -f docker-compose.dev.yml up -d
# 停止:docker compose -f docker-compose.dev.yml down
# 清除数据:docker compose -f docker-compose.dev.yml down -v

services:
  postgres:
    image: pgvector/pgvector:pg16
    container_name: interview-postgres
    environment:
      POSTGRES_USER: ${POSTGRES_USER:-postgres}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-123456}
      POSTGRES_DB: ${POSTGRES_DB:-interview_guide}
    volumes:
      - postgres_data:/var/lib/postgresql/data
      - ./docker/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
    ports:
      - "5432:5432"
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      interval: 5s
      timeout: 5s
      retries: 5

  redis:
    image: redis:7
    container_name: interview-redis
    ports:
      - "6379:6379"
    volumes:
      - redis_data:/data
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 5s
      timeout: 3s
      retries: 5

  rustfs:
    image: rustfs/rustfs:1.0.0-rc.6
    container_name: interview-rustfs
    command: ["/data"]
    environment:
      RUSTFS_ACCESS_KEY: ${RUSTFS_ACCESS_KEY:-rustfsadmin}
      RUSTFS_SECRET_KEY: ${RUSTFS_SECRET_KEY:-rustfsadmin}
      RUSTFS_RPC_SECRET: ${RUSTFS_RPC_SECRET:?Set RUSTFS_RPC_SECRET in .env}
      RUSTFS_CONSOLE_ENABLE: "true"
    ports:
      - "9000:9000"
      - "9001:9001"
    volumes:
      - rustfs_data:/data
    healthcheck:
      # 确认存储和 IAM 就绪后再标记为健康
      test: ["CMD", "/usr/bin/curl", "--fail", "--silent", "http://localhost:9000/health/ready"]
      interval: 5s
      timeout: 3s
      retries: 5

# 首次启动后,浏览器访问 http://localhost:9001
# 使用 ${RUSTFS_ACCESS_KEY} / ${RUSTFS_SECRET_KEY} 登录,手动创建名为 interview-guide 的 bucket

volumes:
  postgres_data:
  redis_data:
  rustfs_data: