name: ai-retouch-agent services: postgres: image: postgres:17-alpine restart: unless-stopped ports: - "7311:5432" environment: POSTGRES_USER: retouch POSTGRES_PASSWORD: retouch_dev POSTGRES_DB: retouch volumes: - pg_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U retouch -d retouch"] interval: 5s timeout: 3s retries: 10 redis: image: redis:7-alpine restart: unless-stopped ports: - "7312:6379" volumes: - redis_data:/data healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 5s timeout: 3s retries: 10 minio: image: minio/minio:latest restart: unless-stopped command: server /data --console-address ":9001" ports: - "7313:9000" - "7314:9001" environment: MINIO_ROOT_USER: retouch MINIO_ROOT_PASSWORD: retouch_dev volumes: - minio_data:/data healthcheck: test: ["CMD", "mc", "ready", "local"] interval: 5s timeout: 3s retries: 10 # 以下两个仅在部署时启用:docker compose --profile deploy up -d app: profiles: ["deploy"] build: . restart: unless-stopped command: uvicorn app.main:app --host 0.0.0.0 --port 7302 ports: - "7302:7302" env_file: .env environment: DATABASE_URL: postgresql+asyncpg://retouch:retouch_dev@postgres:5432/retouch REDIS_URL: redis://redis:6379 S3_ENDPOINT: http://minio:9000 S3_PUBLIC_ENDPOINT: http://localhost:7313 volumes: - cv_models:/root/.u2net depends_on: postgres: { condition: service_healthy } redis: { condition: service_healthy } minio: { condition: service_healthy } worker: profiles: ["deploy"] build: . restart: unless-stopped command: arq app.worker.WorkerSettings env_file: .env environment: DATABASE_URL: postgresql+asyncpg://retouch:retouch_dev@postgres:5432/retouch REDIS_URL: redis://redis:6379 S3_ENDPOINT: http://minio:9000 S3_PUBLIC_ENDPOINT: http://localhost:7313 volumes: - cv_models:/root/.u2net depends_on: postgres: { condition: service_healthy } redis: { condition: service_healthy } minio: { condition: service_healthy } volumes: pg_data: redis_data: minio_data: cv_models: