# PCB AFM Simulation System - Docker Compose services: backend: build: context: . dockerfile: Dockerfile container_name: afm-backend ports: - "8000:8000" volumes: - ./output:/app/output - ./models:/app/models:ro - ./web/backend/.env:/app/.env:ro # E3 fix: persist SQLite database across container rebuilds - ./web/backend/data:/app/data environment: - DATABASE_URL=sqlite:///./data/afm_sim.db - MAX_PARALLEL_TASKS=2 # E2 fix: removed KIMI_API_KEY empty default that shadowed .env value. # The key is loaded from the mounted .env file by config.py. restart: unless-stopped healthcheck: test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/api/health')"] interval: 30s timeout: 10s retries: 3 frontend: image: nginx:alpine container_name: afm-frontend ports: - "5173:80" volumes: - ./web/frontend/dist:/usr/share/nginx/html:ro - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro depends_on: - backend restart: unless-stopped