# 本地开发依赖服务 # 用法: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: