diff --git a/docker-compose.production.yml b/docker-compose.production.yml index 60cc392..f71e84d 100644 --- a/docker-compose.production.yml +++ b/docker-compose.production.yml @@ -1,21 +1,21 @@ -# ═══════════════════════════════════════════════════════════════ # Imago — Docker Compose Production -# ═══════════════════════════════════════════════════════════════ -# Utilise l'image depuis le registry local (pas de build). -# Déploiement : copier ce fichier + .env.production sur le serveur. -# -# Usage : -# docker compose -f docker-compose.production.yml up -d -# docker compose -f docker-compose.production.yml pull # mise à jour -# ═══════════════════════════════════════════════════════════════ +# Usage: docker compose -f docker-compose.production.yml up -d services: - # ── API Backend ──────────────────────────────────────────── backend: image: docker-registry.dev.home:5000/imago-backend:latest ports: - - "8000:8000" + - '8000:8000' env_file: .env.production + environment: + REDIS_URL: redis://redis:6379/0 + DATABASE_URL: postgresql+asyncpg://imago:imago@db:5432/imago + STORAGE_BACKEND: s3 + S3_ENDPOINT_URL: http://minio:9000 + S3_BUCKET: imago + S3_ACCESS_KEY: minioadmin + S3_SECRET_KEY: minioadmin + S3_REGION: us-east-1 volumes: - uploads:/app/data/uploads - thumbnails:/app/data/thumbnails @@ -26,11 +26,19 @@ services: condition: service_healthy restart: unless-stopped - # ── Worker ARQ (pipeline AI) ─────────────────────────────── worker: image: docker-registry.dev.home:5000/imago-backend:latest command: python worker.py env_file: .env.production + environment: + REDIS_URL: redis://redis:6379/0 + DATABASE_URL: postgresql+asyncpg://imago:imago@db:5432/imago + STORAGE_BACKEND: s3 + S3_ENDPOINT_URL: http://minio:9000 + S3_BUCKET: imago + S3_ACCESS_KEY: minioadmin + S3_SECRET_KEY: minioadmin + S3_REGION: us-east-1 depends_on: db: condition: service_healthy @@ -38,42 +46,37 @@ services: condition: service_healthy restart: unless-stopped - # ── PostgreSQL ───────────────────────────────────────────── db: image: postgres:16-alpine environment: POSTGRES_USER: imago POSTGRES_PASSWORD: imago POSTGRES_DB: imago - env_file: .env.production volumes: - pgdata:/var/lib/postgresql/data - ./backups:/backups healthcheck: - test: ["CMD-SHELL", "pg_isready -U imago -d imago"] + test: ['CMD-SHELL', 'pg_isready -U imago -d imago'] interval: 5s timeout: 5s retries: 5 restart: unless-stopped - # ── Redis ────────────────────────────────────────────────── redis: image: redis:7-alpine command: redis-server --appendonly yes --maxmemory 256mb --maxmemory-policy allkeys-lru volumes: - redisdata:/data healthcheck: - test: ["CMD", "redis-cli", "ping"] + test: ['CMD', 'redis-cli', 'ping'] interval: 10s timeout: 5s retries: 3 restart: unless-stopped - # ── MinIO (stockage S3) ──────────────────────────────────── minio: image: minio/minio - command: server /data --console-address ":9001" - env_file: .env.production + command: server /data --console-address ':9001' environment: MINIO_ROOT_USER: minioadmin MINIO_ROOT_PASSWORD: minioadmin