- Add Redis container back (no external port exposure) - Redis only accessible within Docker network - Backend connects via redis://redis:6379/0 - Simplify Redis health check in deploy.sh This avoids port conflicts while keeping Redis in Docker. Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
92 lines
2.4 KiB
YAML
92 lines
2.4 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
|
|
|
|
volumes:
|
|
# Persistent storage for uploads
|
|
- ./backend/uploads:/app/uploads
|
|
# Persistent database (SQLite)
|
|
- ./backend/data:/app/data
|
|
# Persistent templates
|
|
- ./backend/output:/app/output
|
|
# 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
|