docker-compose.yml 967 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # PCB AFM Simulation System - Docker Compose
  2. version: "3.8"
  3. services:
  4. backend:
  5. build:
  6. context: .
  7. dockerfile: Dockerfile
  8. container_name: afm-backend
  9. ports:
  10. - "8000:8000"
  11. volumes:
  12. - ./output:/app/output
  13. - ./models:/app/models:ro
  14. - ./web/backend/.env:/app/.env:ro
  15. environment:
  16. - DATABASE_URL=sqlite:///./afm_sim.db
  17. - MAX_PARALLEL_TASKS=2
  18. - KIMI_API_KEY=${KIMI_API_KEY:-}
  19. restart: unless-stopped
  20. healthcheck:
  21. test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/api/health')"]
  22. interval: 30s
  23. timeout: 10s
  24. retries: 3
  25. frontend:
  26. image: nginx:alpine
  27. container_name: afm-frontend
  28. ports:
  29. - "5173:80"
  30. volumes:
  31. - ./web/frontend/dist:/usr/share/nginx/html:ro
  32. - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
  33. depends_on:
  34. - backend
  35. restart: unless-stopped
  36. volumes:
  37. output: