/docker-compose.yml

https://github.com/mozilla/foundation.mozilla.org · YAML · 53 lines · 45 code · 5 blank · 3 comment · 0 complexity · 00041cb1ee94d18110539caaf65bc40a MD5 · raw file

  1. version: '3'
  2. services:
  3. watch-static-files:
  4. build:
  5. context: .
  6. dockerfile: ./dockerfiles/Dockerfile.node
  7. env_file:
  8. - .env
  9. environment:
  10. # Need to specify the SHELL env var for chokidar
  11. - SHELL=/bin/sh
  12. # Force polling because inotify doesn't work on Docker Windows
  13. - CHOKIDAR_USEPOLLING=1
  14. command: npm run watch
  15. volumes:
  16. - .:/app:delegated
  17. - node_modules:/app/node_modules/:delegated
  18. postgres:
  19. image: postgres:10.12
  20. ports:
  21. - "5678:5432"
  22. environment:
  23. - POSTGRES_DB=wagtail
  24. - POSTGRES_USER=foundation
  25. # We're only using this setting for local dev!
  26. - POSTGRES_HOST_AUTH_METHOD=trust
  27. volumes:
  28. - postgres_data:/var/lib/postgresql/data/:delegated
  29. backend:
  30. build:
  31. context: .
  32. dockerfile: ./dockerfiles/Dockerfile.python
  33. env_file:
  34. - ".env"
  35. command: dockerpythonvenv/bin/python network-api/manage.py runserver 0.0.0.0:8000
  36. ports:
  37. - "8000:8000"
  38. - "8001:8001" # ptvsd port for debugging
  39. volumes:
  40. - .:/app:delegated
  41. - dockerpythonvenv:/app/dockerpythonvenv/:delegated
  42. depends_on:
  43. - postgres
  44. - watch-static-files
  45. volumes:
  46. postgres_data:
  47. node_modules:
  48. dockerpythonvenv: