local-docker-compose.override.yml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. version: "3.3"
  2. services:
  3. proxy:
  4. ports:
  5. - "80:80"
  6. - "8090:8080"
  7. command:
  8. # Enable Docker in Traefik, so that it reads labels from Docker services
  9. - --providers.docker
  10. # Add a constraint to only use services with the label for this stack
  11. # from the env var TRAEFIK_TAG
  12. - --providers.docker.constraints=Label(`traefik.constraint-label-stack`, `${TRAEFIK_TAG?Variable not set}`)
  13. # Do not expose all Docker services, only the ones explicitly exposed
  14. - --providers.docker.exposedbydefault=false
  15. # Disable Docker Swarm mode for local development
  16. # - --providers.docker.swarmmode
  17. # Enable the access log, with HTTP requests
  18. - --accesslog
  19. # Enable the Traefik log, for configurations and errors
  20. - --log
  21. # Enable the Dashboard and API
  22. - --api
  23. # Enable the Dashboard and API in insecure mode for local development
  24. - --api.insecure=true
  25. labels:
  26. - traefik.enable=true
  27. - traefik.http.routers.${STACK_NAME?Variable not set}-traefik-public-http.rule=Host(`${DOMAIN?Variable not set}`)
  28. - traefik.http.services.${STACK_NAME?Variable not set}-traefik-public.loadbalancer.server.port=80
  29. flower:
  30. ports:
  31. - "5555:5555"
  32. backend:
  33. volumes:
  34. - ./backend/app:/app
  35. build:
  36. context: ./backend
  37. dockerfile: backend.dockerfile
  38. args:
  39. INSTALL_DEV: ${INSTALL_DEV-true}
  40. INSTALL_JUPYTER: ${INSTALL_JUPYTER-true}
  41. # command: bash -c "while true; do sleep 1; done" # Infinite loop to keep container live doing nothing
  42. command: /start-reload.sh
  43. labels:
  44. - traefik.enable=true
  45. - traefik.constraint-label-stack=${TRAEFIK_TAG?Variable not set}
  46. - traefik.http.routers.${STACK_NAME?Variable not set}-backend-http.rule=PathPrefix(`/api`) || PathPrefix(`/docs`) || PathPrefix(`/redoc`)
  47. - traefik.http.services.${STACK_NAME?Variable not set}-backend.loadbalancer.server.port=80
  48. celeryworker:
  49. volumes:
  50. - ./backend/app:/app
  51. environment:
  52. - RUN=celery worker -A app.worker -l info -Q main-queue -c 1
  53. - JUPYTER=jupyter lab --ip=0.0.0.0 --allow-root --NotebookApp.custom_display_url=http://127.0.0.1:8888
  54. - SERVER_HOST=http://${DOMAIN?Variable not set}
  55. build:
  56. context: ./backend
  57. dockerfile: celeryworker.dockerfile
  58. args:
  59. INSTALL_DEV: ${INSTALL_DEV-true}
  60. INSTALL_JUPYTER: ${INSTALL_JUPYTER-true}
  61. networks:
  62. traefik-public:
  63. # For local dev, don't expect an external Traefik network
  64. external: false