services: postgres: image: postgres:16-alpine container_name: docforge-postgres environment: POSTGRES_USER: ${POSTGRES_USER:-docforge} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-docforge} POSTGRES_DB: ${POSTGRES_DB:-docforge} ports: - "5432:5432" volumes: - postgres_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-docforge}"] interval: 5s timeout: 5s retries: 5 restart: unless-stopped redis: image: redis:7-alpine container_name: docforge-redis ports: - "6379:6379" volumes: - redis_data:/data healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 5s timeout: 5s retries: 5 restart: unless-stopped backend: build: context: ./backend dockerfile: Dockerfile container_name: docforge-backend environment: POSTGRES_USER: ${POSTGRES_USER:-docforge} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-docforge} POSTGRES_DB: ${POSTGRES_DB:-docforge} POSTGRES_HOST: postgres POSTGRES_PORT: 5432 REDIS_URL: redis://redis:6379/0 CELERY_BROKER_URL: redis://redis:6379/0 CELERY_RESULT_BACKEND: redis://redis:6379/1 SECRET_KEY: ${SECRET_KEY} STORAGE_ROOT: /app/storage CORS_ORIGINS: '["http://localhost:3000","http://localhost:80","http://localhost"]' ports: - "8000:8000" volumes: - storage_data:/app/storage depends_on: postgres: condition: service_healthy redis: condition: service_healthy restart: unless-stopped celery-worker: build: context: ./backend dockerfile: Dockerfile.celery container_name: docforge-celery environment: POSTGRES_USER: ${POSTGRES_USER:-docforge} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-docforge} POSTGRES_DB: ${POSTGRES_DB:-docforge} POSTGRES_HOST: postgres POSTGRES_PORT: 5432 REDIS_URL: redis://redis:6379/0 CELERY_BROKER_URL: redis://redis:6379/0 CELERY_RESULT_BACKEND: redis://redis:6379/1 SECRET_KEY: ${SECRET_KEY} STORAGE_ROOT: /app/storage volumes: - storage_data:/app/storage depends_on: postgres: condition: service_healthy redis: condition: service_healthy restart: unless-stopped nginx: build: context: ./web dockerfile: Dockerfile container_name: docforge-nginx ports: - "3000:80" depends_on: - backend restart: unless-stopped volumes: postgres_data: redis_data: storage_data: