local-docker-compose.override.yml 2.8 KB

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