88 lines
3.2 KiB
YAML
88 lines
3.2 KiB
YAML
# ═══════════════════════════════════════════════════════════════
|
|
# 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
|
|
# ═══════════════════════════════════════════════════════════════
|
|
|
|
services:
|
|
# ── API Backend ────────────────────────────────────────────
|
|
backend:
|
|
image: docker-registry.dev.home:5000/imago-backend:latest
|
|
ports:
|
|
- "8000:8000"
|
|
env_file: .env.production
|
|
volumes:
|
|
- uploads:/app/data/uploads
|
|
- thumbnails:/app/data/thumbnails
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
redis:
|
|
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
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
|
|
# ── PostgreSQL ─────────────────────────────────────────────
|
|
db:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_USER: 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"]
|
|
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"]
|
|
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
|
|
environment:
|
|
MINIO_ROOT_USER: minioadmin
|
|
volumes:
|
|
- miniodata:/data
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
pgdata:
|
|
redisdata:
|
|
miniodata:
|
|
uploads:
|
|
thumbnails:
|