- Fix Windows line endings (CRLF) in docker-build.sh script - Remove deprecated 'version' field from docker-compose.dev.yml - Standardize database URL paths across compose files - Optimize Dockerfile.production with better pip upgrade handling - Improve health check timings for better container startup - Add comprehensive Docker usage documentation - Ensure all Docker files use consistent formatting and best practices All Docker builds now work correctly and containers start successfully.
63 lines
1.8 KiB
YAML
63 lines
1.8 KiB
YAML
services:
|
|
delphi-db:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.production
|
|
args:
|
|
BASE_IMAGE: ${BASE_IMAGE:-python:3.12-slim}
|
|
container_name: delphi-database
|
|
ports:
|
|
- "${EXTERNAL_PORT:-6920}:8000"
|
|
environment:
|
|
- DATABASE_URL=${DATABASE_URL:-sqlite:///app/data/delphi_database.db}
|
|
- SECRET_KEY=${SECRET_KEY}
|
|
- DEBUG=${DEBUG:-False}
|
|
- ACCESS_TOKEN_EXPIRE_MINUTES=${ACCESS_TOKEN_EXPIRE_MINUTES:-30}
|
|
- CREATE_ADMIN_USER=${CREATE_ADMIN_USER:-false}
|
|
- ADMIN_USERNAME=${ADMIN_USERNAME:-admin}
|
|
- ADMIN_EMAIL=${ADMIN_EMAIL:-admin@delphicg.local}
|
|
- ADMIN_PASSWORD=${ADMIN_PASSWORD}
|
|
- ADMIN_FULLNAME=${ADMIN_FULLNAME:-System Administrator}
|
|
- WORKERS=${WORKERS:-4}
|
|
- WORKER_TIMEOUT=${WORKER_TIMEOUT:-120}
|
|
- LOG_LEVEL=${LOG_LEVEL:-INFO}
|
|
volumes:
|
|
# Database and persistent data - using local directory for development
|
|
- ./data:/app/data
|
|
# File uploads
|
|
- delphi_uploads:/app/uploads
|
|
# Database backups
|
|
- delphi_backups:/app/backups
|
|
# Optional: Use Docker volume for production
|
|
# - delphi_data:/app/data
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
|
|
# Optional: Nginx reverse proxy for production
|
|
nginx:
|
|
image: nginx:alpine
|
|
container_name: delphi-nginx
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
volumes:
|
|
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
|
|
- ./nginx/ssl:/etc/nginx/ssl:ro
|
|
- delphi_uploads:/var/www/uploads:ro
|
|
depends_on:
|
|
- delphi-db
|
|
restart: unless-stopped
|
|
profiles: ["production"]
|
|
|
|
volumes:
|
|
delphi_data:
|
|
driver: local
|
|
delphi_uploads:
|
|
driver: local
|
|
delphi_backups:
|
|
driver: local |