Fix production compose: explicit REDIS_URL + DATABASE_URL in environment (override corrupted env_file)
This commit is contained in:
@@ -1,21 +1,21 @@
|
|||||||
# ═══════════════════════════════════════════════════════════════
|
|
||||||
# Imago — Docker Compose Production
|
# Imago — Docker Compose Production
|
||||||
# ═══════════════════════════════════════════════════════════════
|
# Usage: docker compose -f docker-compose.production.yml up -d
|
||||||
# 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:
|
services:
|
||||||
# ── API Backend ────────────────────────────────────────────
|
|
||||||
backend:
|
backend:
|
||||||
image: docker-registry.dev.home:5000/imago-backend:latest
|
image: docker-registry.dev.home:5000/imago-backend:latest
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000"
|
- '8000:8000'
|
||||||
env_file: .env.production
|
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:
|
volumes:
|
||||||
- uploads:/app/data/uploads
|
- uploads:/app/data/uploads
|
||||||
- thumbnails:/app/data/thumbnails
|
- thumbnails:/app/data/thumbnails
|
||||||
@@ -26,11 +26,19 @@ services:
|
|||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
# ── Worker ARQ (pipeline AI) ───────────────────────────────
|
|
||||||
worker:
|
worker:
|
||||||
image: docker-registry.dev.home:5000/imago-backend:latest
|
image: docker-registry.dev.home:5000/imago-backend:latest
|
||||||
command: python worker.py
|
command: python worker.py
|
||||||
env_file: .env.production
|
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:
|
depends_on:
|
||||||
db:
|
db:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
@@ -38,42 +46,37 @@ services:
|
|||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
# ── PostgreSQL ─────────────────────────────────────────────
|
|
||||||
db:
|
db:
|
||||||
image: postgres:16-alpine
|
image: postgres:16-alpine
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_USER: imago
|
POSTGRES_USER: imago
|
||||||
POSTGRES_PASSWORD: imago
|
POSTGRES_PASSWORD: imago
|
||||||
POSTGRES_DB: imago
|
POSTGRES_DB: imago
|
||||||
env_file: .env.production
|
|
||||||
volumes:
|
volumes:
|
||||||
- pgdata:/var/lib/postgresql/data
|
- pgdata:/var/lib/postgresql/data
|
||||||
- ./backups:/backups
|
- ./backups:/backups
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "pg_isready -U imago -d imago"]
|
test: ['CMD-SHELL', 'pg_isready -U imago -d imago']
|
||||||
interval: 5s
|
interval: 5s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 5
|
retries: 5
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
# ── Redis ──────────────────────────────────────────────────
|
|
||||||
redis:
|
redis:
|
||||||
image: redis:7-alpine
|
image: redis:7-alpine
|
||||||
command: redis-server --appendonly yes --maxmemory 256mb --maxmemory-policy allkeys-lru
|
command: redis-server --appendonly yes --maxmemory 256mb --maxmemory-policy allkeys-lru
|
||||||
volumes:
|
volumes:
|
||||||
- redisdata:/data
|
- redisdata:/data
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "redis-cli", "ping"]
|
test: ['CMD', 'redis-cli', 'ping']
|
||||||
interval: 10s
|
interval: 10s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 3
|
retries: 3
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
# ── MinIO (stockage S3) ────────────────────────────────────
|
|
||||||
minio:
|
minio:
|
||||||
image: minio/minio
|
image: minio/minio
|
||||||
command: server /data --console-address ":9001"
|
command: server /data --console-address ':9001'
|
||||||
env_file: .env.production
|
|
||||||
environment:
|
environment:
|
||||||
MINIO_ROOT_USER: minioadmin
|
MINIO_ROOT_USER: minioadmin
|
||||||
MINIO_ROOT_PASSWORD: minioadmin
|
MINIO_ROOT_PASSWORD: minioadmin
|
||||||
|
|||||||
Reference in New Issue
Block a user