docker-compose.yml 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. # PCB AFM Simulation System - Docker Compose
  2. services:
  3. backend:
  4. build:
  5. context: .
  6. dockerfile: Dockerfile
  7. container_name: afm-backend
  8. ports:
  9. - "8000:8000"
  10. volumes:
  11. - ./output:/app/output
  12. - ./models:/app/models:ro
  13. - ./web/backend/.env:/app/.env:ro
  14. # E3 fix: persist SQLite database across container rebuilds
  15. - ./web/backend/data:/app/data
  16. environment:
  17. - DATABASE_URL=sqlite:///./data/afm_sim.db
  18. - MAX_PARALLEL_TASKS=2
  19. # E2 fix: removed KIMI_API_KEY empty default that shadowed .env value.
  20. # The key is loaded from the mounted .env file by config.py.
  21. restart: unless-stopped
  22. healthcheck:
  23. test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/api/health')"]
  24. interval: 30s
  25. timeout: 10s
  26. retries: 3
  27. frontend:
  28. image: nginx:alpine
  29. container_name: afm-frontend
  30. ports:
  31. - "5173:80"
  32. volumes:
  33. - ./web/frontend/dist:/usr/share/nginx/html:ro
  34. - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
  35. depends_on:
  36. - backend
  37. restart: unless-stopped