forked from TheSpaghettiDetective/obico-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
64 lines (58 loc) · 1.9 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
version: '2.4'
x-web-defaults: &web-defaults
restart: unless-stopped
build:
context: web
volumes:
- ./web:/app
depends_on:
- redis
environment:
EMAIL_HOST: # -> such as smtp.gmail.com
EMAIL_HOST_USER: # -> such as your email address for a Gmail account
EMAIL_HOST_PASSWORD: # -> your email account password
EMAIL_PORT: 587
EMAIL_USE_TLS: 'True'
DEFAULT_FROM_EMAIL: '[email protected]'
DEBUG: 'False' # Don't set DEBUG to True, otherwise the static files will be cached in browser until hard-refresh
SITE_USES_HTTPS: 'False' # set it to 'True' if https is set up
SOCIAL_LOGIN: 'False'
REDIS_URL: 'redis://redis:6379'
DATABASE_URL: 'sqlite:////app/db.sqlite3'
INTERNAL_MEDIA_HOST: 'http://web:3334'
ML_API_HOST: 'http://ml_api:3333'
#### Optional env vars below this line ###
# TWILIO_ACCOUNT_SID: https://django-twilio.readthedocs.io/en/latest/settings.html for how to find and set the TWILIO_XXX vars
# TWILIO_AUTH_TOKEN:
# TWILIO_FROM_NUMBER:
# ENALBE_HISTORY:
# ML_API_TOKEN:
# SENTRY_DSN:
# TELEGRAM_BOT_TOKEN: https://core.telegram.org/bots#6-botfather for how to create a telegram bot and get its token
services:
ml_api:
hostname: ml_api
restart: unless-stopped
build:
context: ml_api
environment:
DEBUG: 'True'
FLASK_APP: 'server.py'
# ML_API_TOKEN:
# HAS_GPU: 'False'
command: bash -c "gunicorn --bind 0.0.0.0:3333 --workers 2 wsgi"
web:
<<: *web-defaults
hostname: web
ports:
- "3334:3334"
depends_on:
- ml_api
command: sh -c "python manage.py collectstatic --noinput && python manage.py migrate && python manage.py runserver 0.0.0.0:3334"
tasks:
<<: *web-defaults
hostname: tasks
command: sh -c "celery -A config worker --beat -l info"
redis:
restart: unless-stopped
image: redis:5.0-alpine