- Auto pull latest code before deployment - Clean old Docker images before building new ones - Add comprehensive cleanup commands documentation - Add production deployment guide - Fix frontend serving from /var/www/html for production - Preserve build cache for faster deployments Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
98 lines
2.7 KiB
YAML
98 lines
2.7 KiB
YAML
version: '3.9'
|
|
|
|
services:
|
|
# Redis for session storage (internal only, no external port)
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: oliver-redis
|
|
restart: unless-stopped
|
|
volumes:
|
|
- redis-data:/data
|
|
command: redis-server --appendonly yes
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 10s
|
|
timeout: 3s
|
|
retries: 3
|
|
networks:
|
|
- oliver-network
|
|
|
|
# FastAPI Backend
|
|
backend:
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
container_name: oliver-backend
|
|
restart: unless-stopped
|
|
environment:
|
|
# Database - use SQLite by default (simpler for migration)
|
|
DATABASE_URL: sqlite+aiosqlite:///./data/oliver_metadata.db
|
|
# Or use PostgreSQL:
|
|
# DATABASE_URL: postgresql+asyncpg://oliver:${DB_PASSWORD:-changeme}@postgres:5432/oliver_metadata
|
|
|
|
# Redis (internal Docker network)
|
|
REDIS_URL: redis://redis:6379/0
|
|
|
|
# Security
|
|
SECRET_KEY: ${SECRET_KEY:-please-change-this-secret-key-in-production}
|
|
|
|
# OpenAI (for AI metadata generation)
|
|
OPENAI_API_KEY: ${OPENAI_API_KEY}
|
|
AI_MODEL: ${AI_MODEL:-gpt-4o-mini}
|
|
MAX_TOKENS: ${MAX_TOKENS:-500}
|
|
TEMPERATURE: ${TEMPERATURE:-0.5}
|
|
|
|
# Microsoft SSO (optional)
|
|
AZURE_CLIENT_ID: ${AZURE_CLIENT_ID}
|
|
AZURE_CLIENT_SECRET: ${AZURE_CLIENT_SECRET}
|
|
AZURE_TENANT_ID: ${AZURE_TENANT_ID}
|
|
REDIRECT_URI: ${REDIRECT_URI:-http://localhost:8000/auth/microsoft/callback}
|
|
|
|
# Debugging
|
|
DEBUG: ${DEBUG:-false}
|
|
|
|
# Upload directory
|
|
UPLOAD_DIR: /app/uploads
|
|
|
|
# Frontend directory (for serving static files)
|
|
FRONTEND_DIR: /app/frontend/dist
|
|
|
|
volumes:
|
|
# Persistent storage for uploads
|
|
- ./backend/uploads:/app/uploads
|
|
# Persistent database (SQLite)
|
|
- ./backend/data:/app/data
|
|
# Persistent templates
|
|
- ./backend/output:/app/output
|
|
# Frontend static files (local dev only - on production, frontend is served by Apache/Nginx)
|
|
# Comment out the next line for production deployment:
|
|
- ./frontend/dist:/app/frontend/dist:ro
|
|
# Excel lookup file (optional - comment out if file doesn't exist)
|
|
# - ./Celum ID to Adobe Asset Path Mapping Spreadsheet (1).xlsx:/app/Celum ID to Adobe Asset Path Mapping Spreadsheet (1).xlsx:ro
|
|
|
|
ports:
|
|
- "${BACKEND_PORT:-5001}:8000"
|
|
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
|
|
networks:
|
|
- oliver-network
|
|
|
|
command: uvicorn app.main:app --host 0.0.0.0 --port 8000
|
|
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
|
|
volumes:
|
|
redis-data:
|
|
driver: local
|
|
|
|
networks:
|
|
oliver-network:
|
|
driver: bridge
|