- Remove deprecated version field - Keep only essential services: dev, prod, cli - Remove complex services: test, docs, nginx, monitoring - Remove custom networks for simplicity - Focus on core application containers - Update service configurations for simplified Dockerfile
79 lines
2.0 KiB
YAML
79 lines
2.0 KiB
YAML
# UnitForge Docker Compose Configuration
|
|
# Simple configuration for building and running the application
|
|
|
|
services:
|
|
# Development service with hot reload
|
|
unitforge-dev:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: unitforge-dev
|
|
ports:
|
|
- "8000:8000"
|
|
volumes:
|
|
- .:/app
|
|
- /app/.venv # Exclude venv from bind mount
|
|
- /app/backend/__pycache__ # Exclude cache
|
|
- /app/.pytest_cache
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
- DEBUG=true
|
|
- LOG_LEVEL=debug
|
|
- RELOAD=true
|
|
- PYTHONPATH=/app/backend
|
|
command: ["./start-server.sh", "--host", "0.0.0.0", "--log-level", "debug"]
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
|
|
# Production service
|
|
unitforge-prod:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: unitforge-prod
|
|
ports:
|
|
- "8080:8000"
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
- DEBUG=false
|
|
- LOG_LEVEL=info
|
|
- RELOAD=false
|
|
- PYTHONPATH=/app/backend
|
|
command:
|
|
["uvicorn", "backend.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: 30s
|
|
restart: unless-stopped
|
|
|
|
# CLI-only service for batch operations
|
|
unitforge-cli:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: unitforge-cli
|
|
volumes:
|
|
- ./output:/output # Mount for output files
|
|
- ./input:/input # Mount for input files
|
|
working_dir: /app
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
- PYTHONPATH=/app/backend
|
|
entrypoint: ["./unitforge-cli"]
|
|
profiles:
|
|
- cli
|
|
# Usage examples:
|
|
# Development: docker-compose up unitforge-dev
|
|
# Production: docker-compose up unitforge-prod
|
|
# CLI only: docker-compose --profile cli run --rm unitforge-cli --help
|