-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
117 lines (114 loc) · 3.83 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
version: '3.7'
x-common-env: &default-env
DJANGO_SECRET_KEY: "${SECRET_KEY}"
HTTPS: 'true'
DEBUG: 'false'
SQL_HOST: db
SQL_PORT: '5432'
WAIT_FOR_POSTGRES: "true"
DATABASE_URL: postgres://postgres:postgres@db/postgres
REDIS_LAYER: "true"
REDIS_HOST: "redis"
SENTRY_DSN: "http://[email protected]:9000/2"
TRANSFORMERS_CACHE: "/usr/src/transformers/"
services:
reverse-proxy:
image: traefik:v2.1
restart: always
ports:
- "80:80"
- "8080:8080"
- "443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./traefik/traefik.toml:/traefik.toml
- ./letsencrypt:/letsencrypt
labels:
- "traefik.enable=true"
- "traefik.http.routers.http-catchall.rule=hostregexp(`cf3.ijs.si`)"
- "traefik.http.routers.http-catchall.entrypoints=web"
- "traefik.http.routers.http-catchall.middlewares=redirect-to-https"
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
db:
image: postgres:10.5-alpine
restart: always
volumes:
- ./volumes/postgres_data:/var/lib/postgresql/data
redis:
image: redis:5.0.5-alpine
volumes:
- ./volumes/redis:/data
restart: always
staticfiles:
image: nginx:stable-alpine
expose:
- 80
volumes:
- ./volumes/static:/usr/share/nginx/html/static
- ./volumes/media:/usr/share/nginx/html/media
labels:
- traefik.http.routers.staticfiles.entrypoints=websecure
- traefik.http.routers.staticfiles.rule=Host(`cf3.ijs.si`) && PathPrefix(`/static`,`/media`)
- traefik.enable=true
- traefik.http.routers.staticfiles.tls.certresolver=myresolver
daphne:
image: cf3-ijs-si-backend
build:
context: backend/.
expose:
- 8000
environment:
<<: *default-env
command: sh -c "daphne -b 0.0.0.0 -p 8000 mothra.asgi:channel_layer"
labels:
- traefik.http.routers.daphne.rule=Host(`cf3.ijs.si`) && PathPrefix(`/editor-updates/`)
- traefik.enable=true
- traefik.http.routers.daphne.entrypoints=websecure
- traefik.http.routers.daphne.tls.certresolver=myresolver
volumes:
- ./volumes/static:/usr/src/app/mothra/public/static
- ./volumes/media:/usr/src/app/mothra/public/media
backend:
image: cf3-ijs-si-backend
build:
context: backend/.
command: sh -c "gunicorn mothra.wsgi:application --workers=17 --bind 0.0.0.0:8000 --timeout=900"
environment:
<<: *default-env
COLLECTSTATIC: "true"
MIGRATE: "true"
expose:
- 8000
labels:
- traefik.http.routers.backend.rule=Host(`cf3.ijs.si`) && PathPrefix(`/api/`,`/admin/`,`/workflows/`)
- traefik.enable=true
- traefik.http.routers.backend.entrypoints=websecure
- traefik.http.routers.backend.tls.certresolver=myresolver
volumes:
- ./volumes/files:/usr/src/app/mothra/public/files
- ./volumes/static:/usr/src/app/mothra/public/static
- ./volumes/media:/usr/src/app/mothra/public/media
- ./volumes/transformers:/usr/src/transformers
- ./volumes/cf_text_embeddings:/root/.cf_text_embeddings
webapp:
image: xflows/clowdflows-webapp
labels:
- traefik.http.routers.webapp.rule=Host(`cf3.ijs.si`)
- traefik.enable=true
- traefik.http.routers.webapp.entrypoints=websecure
- traefik.http.routers.webapp.tls.certresolver=myresolver
expose:
- 80
worker:
image: cf3-ijs-si-backend
build:
context: backend/.
environment:
<<: *default-env
command: sh -c "python manage.py runworker"
volumes:
- ./volumes/files:/usr/src/app/mothra/public/files
- ./volumes/static:/usr/src/app/mothra/public/static
- ./volumes/media:/usr/src/app/mothra/public/media
- ./volumes/transformers:/usr/src/transformers
- ./volumes/cf_text_embeddings:/root/.cf_text_embeddings