version: "3.9" services: # ── PostgreSQL with pgvector ────────────────────────────────────────────── postgres: image: pgvector/pgvector:pg16 environment: POSTGRES_USER: nwo POSTGRES_PASSWORD: nwopass POSTGRES_DB: nwo_gallery ports: - "5432:5432" volumes: - postgres_data:/var/lib/postgresql/data - ./scripts/init_db.sql:/docker-entrypoint-initdb.d/01_init.sql healthcheck: test: ["CMD-SHELL", "pg_isready -U nwo -d nwo_gallery"] interval: 10s timeout: 5s retries: 5 # ── MinIO (S3-compatible blob store) ───────────────────────────────────── minio: image: minio/minio:latest command: server /data --console-address ":9001" environment: MINIO_ROOT_USER: minioadmin MINIO_ROOT_PASSWORD: password123 ports: - "9000:9000" - "9001:9001" # MinIO console volumes: - minio_data:/data healthcheck: test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] interval: 15s timeout: 5s retries: 5 # ── MinIO bucket setup (runs once) ─────────────────────────────────────── minio-init: image: minio/mc:latest depends_on: minio: condition: service_healthy entrypoint: > /bin/sh -c " mc alias set local http://minio:9000 minioadmin password123; mc mb --ignore-existing local/nwo-parts; mc anonymous set public local/nwo-parts; echo 'MinIO bucket ready'; " # ── Parts Gallery API ───────────────────────────────────────────────────── gallery: build: . ports: - "8001:8001" env_file: - .env environment: DATABASE_URL: postgresql+asyncpg://nwo:nwopass@postgres:5432/nwo_gallery SYNC_DATABASE_URL: postgresql://nwo:nwopass@postgres:5432/nwo_gallery STORAGE_BACKEND: minio STORAGE_BUCKET: nwo-parts STORAGE_ENDPOINT_URL: http://minio:9000 STORAGE_PUBLIC_URL: http://localhost:9000/nwo-parts AWS_ACCESS_KEY_ID: minioadmin AWS_SECRET_ACCESS_KEY: password123 API_PORT: "8001" depends_on: postgres: condition: service_healthy minio: condition: service_healthy restart: unless-stopped healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8001/health"] interval: 30s timeout: 10s retries: 3 start_period: 20s volumes: - ./src:/app/src # Remove in production # ── pgAdmin (optional, dev only) ────────────────────────────────────────── pgadmin: image: dpage/pgadmin4:latest profiles: ["dev"] environment: PGADMIN_DEFAULT_EMAIL: admin@nworobotics.cloud PGADMIN_DEFAULT_PASSWORD: admin ports: - "5050:80" depends_on: - postgres volumes: postgres_data: minio_data: