Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
501
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. version: '2.4'
  2.  
  3. x-web-defaults: &web-defaults
  4. restart: unless-stopped
  5. build:
  6. context: web
  7. volumes:
  8. - ./web:/app
  9. depends_on:
  10. - redis
  11. environment:
  12. EMAIL_HOST: # -> such as smtp.gmail.com
  13. EMAIL_HOST_USER: # -> such as your email address for a Gmail account
  14. EMAIL_HOST_PASSWORD: # -> your email account password
  15. EMAIL_PORT: 587
  16. EMAIL_USE_TLS: 'True'
  17. DEFAULT_FROM_EMAIL: 'spaghetti@xxxxxxxx.de'
  18. DEBUG: 'False' # Don't set DEBUG to True, otherwise the static files will be cached in browser until hard-refresh
  19. SITE_USES_HTTPS: 'true' # set it to 'True' if https is set up
  20. SOCIAL_LOGIN: 'False'
  21. REDIS_URL: 'redis://redis:6379'
  22. DATABASE_URL: 'sqlite:////app/db.sqlite3'
  23. INTERNAL_MEDIA_HOST: 'http://web:3334'
  24. ML_API_HOST: 'http://ml_api:3333'
  25.  
  26. #### Optional env vars below this line ###
  27. # TWILIO_ACCOUNT_SID: https://django-twilio.readthedocs.io/en/latest/settings.html for how to find and set the TWILIO_XXX vars
  28. # TWILIO_AUTH_TOKEN:
  29. # TWILIO_FROM_NUMBER:
  30. # ENALBE_HISTORY:
  31. # ML_API_TOKEN:
  32. # SENTRY_DSN:
  33. TELEGRAM_BOT_TOKEN:
  34.  
  35. services:
  36. ml_api:
  37. hostname: ml_api
  38. restart: unless-stopped
  39. build:
  40. context: ml_api
  41. environment:
  42. DEBUG: 'True'
  43. FLASK_APP: 'server.py'
  44. # ML_API_TOKEN:
  45. # HAS_GPU: 'False'
  46. command: bash -c "gunicorn --bind 0.0.0.0:3333 --workers 2 wsgi"
  47.  
  48. web:
  49. <<: *web-defaults
  50. hostname: web
  51. ports:
  52. - "3334:3334"
  53. labels:
  54. - traefik.backend=thespaghettidetective
  55. - traefik.frontend.rule=Host:spaghetti.xxxxxxxxx.de
  56. - traefik.docker.network=web
  57. - traefik.port=3334
  58. networks:
  59. - web
  60. depends_on:
  61. - ml_api
  62. command: sh -c "python manage.py collectstatic --noinput && python manage.py migrate && python manage.py runserver 0.0.0.0:3334"
  63.  
  64. tasks:
  65. <<: *web-defaults
  66. hostname: tasks
  67. command: sh -c "celery -A config worker --beat -l info"
  68.  
  69. redis:
  70. restart: unless-stopped
  71. image: redis:5.0-alpine
  72.  
  73. networks:
  74. web:
  75. external: true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement