docker-compose.yml•1.67 kB
# Docker Compose configuration for NexusMind
services:
# Backend API service for NexusMind
nexusmind-api:
build:
context: . # Use the Dockerfile in the current directory
dockerfile: Dockerfile
container_name: nexusmind-api
restart: unless-stopped
ports:
- "${APP_PORT:-8000}:8000" # Expose port 8000 from container, configurable via .env
volumes:
# Mount the source code for development with hot-reloading (Uvicorn --reload)
# For production, you might remove this or have a different Dockerfile stage
- type: bind
source: ./src
target: /app/src
- type: bind
source: ./config
target: /app/config
# Optional: Mount logs directory if your app writes logs to a file within the container
# - ./logs:/app/logs
environment:
# Environment variables can be set here or in an .env file
# Example:
# LOG_LEVEL: "INFO"
# APP_ENV: "development"
# CONFIG_FILE_PATH: "/app/config/settings.yaml" # Path inside the container
PYTHONUNBUFFERED: "1" # Ensures Python output is sent straight to terminal/logs
PYTHONDONTWRITEBYTECODE: "1" # Prevents .pyc files
# env_file:
# - .env # Uncomment to load environment variables from a .env file
healthcheck:
test: ["CMD", "wget", "-O", "-", "http://localhost:8000/health"] # Assumes a /health endpoint
interval: 30s
timeout: 10s
retries: 3
start_period: 30s # Give more time for the app to start, especially with --reload
networks:
- nexusmind_network
networks:
nexusmind_network:
driver: bridge
name: nexusmind_network