docker-compose.prod.ymlβ’2.69 kB
# Docker Compose configuration for Adaptive Graph of Thoughts - PRODUCTION
version: '3.8' # Specify docker-compose version
services:
# Backend API service for Adaptive Graph of Thoughts
adaptive-graph-of-thoughts-api:
build:
context: .
dockerfile: Dockerfile
container_name: adaptive-graph-of-thoughts-api-prod
restart: unless-stopped
ports:
- "${APP_PORT:-8000}:8000" # Expose port 8000, configurable via .env or environment
# VOLUMES for src and config are REMOVED for production to use code baked into the image.
environment:
APP_ENV: "production"
APP_LOG_LEVEL: "${LOG_LEVEL:-INFO}"
APP_CORS_ALLOWED_ORIGINS_STR: "${CORS_ALLOWED_ORIGINS}"
APP_UVICORN_RELOAD: "False"
APP_UVICORN_WORKERS: "${UVICORN_WORKERS:-4}"
PYTHONUNBUFFERED: "1"
PYTHONDONTWRITEBYTECODE: "1"
MCP_TRANSPORT_TYPE: "${MCP_TRANSPORT_TYPE:-http}"
HOST: "${HOST:-0.0.0.0}"
PORT: "${PORT:-8000}"
LOG_LEVEL: "${LOG_LEVEL:-info}"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
networks:
- adaptive-graph-of-thoughts_network
depends_on:
adaptive-graph-of-thoughts-neo4j:
condition: service_healthy # Wait for Neo4j to be healthy
# Neo4j service
adaptive-graph-of-thoughts-neo4j:
image: neo4j:5.17.0 # Consider using a more specific patch version if available/tested
container_name: adaptive-graph-of-thoughts-neo4j-prod
restart: unless-stopped
ports:
- "7474:7474" # Standard Neo4j browser port
- "7687:7687" # Standard Neo4j Bolt port
volumes:
- neo4j_prod_data:/data # Use a separate volume for production data
environment:
NEO4J_AUTH: "${NEO4J_USER:-neo4j}/${NEO4J_PASSWORD}" # No default β must be set in production
NEO4J_PLUGINS: '["apoc"]' # APOC plugin is required
NEO4J_dbms_security_procedures_unrestricted: "apoc.*" # Allow all APOC procedures
NEO4J_dbms_memory_heap_initial__size: "512m" # Example: Set initial heap size
NEO4J_dbms_memory_heap_max__size: "2G" # Example: Set max heap size
healthcheck:
test: ["CMD-SHELL", "cypher-shell -u ${NEO4J_USER:-neo4j} -p ${NEO4J_PASSWORD} 'RETURN 1' || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 20s
networks:
- adaptive-graph-of-thoughts_network
networks:
adaptive-graph-of-thoughts_network:
driver: bridge
name: adaptive-graph-of-thoughts_prod_network # Separate network for production
volumes:
neo4j_prod_data: {} # Define the production data volume