-
Notifications
You must be signed in to change notification settings - Fork 24
/
docker-compose.yml
195 lines (183 loc) · 5.93 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
version: '3'
services:
reverse-proxy:
image: traefik:v1.7.19
restart: unless-stopped
command: --configFile=/var/traefik/traefik.toml
ports:
- 80:80
- 52000:8080
volumes:
- $PWD/traefik.toml:/var/traefik/traefik.toml
- /var/run/docker.sock:/var/run/docker.sock
labels:
- "traefik.enable=false"
cassandra:
image: cassandra:3.11.9
restart: unless-stopped
volumes:
- cassandra-data:/var/lib/cassandra
ports:
- 9042:9042
labels:
- "traefik.enable=false"
rabbitmq:
image: rabbitmq:3.8.9-management
restart: unless-stopped
volumes:
- rabbitmq-data:/var/lib/rabbitmq/mnesia
ports:
- 5672:5672
- 15672:15672
labels:
- "traefik.enable=false"
postgres:
image: postgres:10.15
restart: unless-stopped
ports:
- 5432:5432
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
POSTGRES_DB: medtagger
POSTGRES_USER: medtagger_user
POSTGRES_PASSWORD: MedTa99er!
# Increase maximum number of connections to give more space for application
command: postgres -c 'max_connections=500'
labels:
- "traefik.enable=false"
netdata:
image: netdata/netdata:v1.28.0
restart: unless-stopped
ports:
- 19999:19999
cap_add:
- SYS_PTRACE
security_opt:
- apparmor:unconfined
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
medtagger_frontend:
image: medtagger/frontend_ui:${MEDTAGGER_VERSION}
restart: unless-stopped
build:
context: frontend
dockerfile: Dockerfile
args:
- PRODUCTION=${MEDTAGGER__FRONTEND_PRODUCTION}
- SUBDIRECTORY=${MEDTAGGER__HOST_ON_SUBDIRECTORY}
depends_on:
- medtagger_backend_rest
labels:
- "traefik.backend=medtagger_frontend"
- "traefik.frontend.rule=PathPrefix: ${MEDTAGGER__HOST_ON_SUBDIRECTORY}; ReplacePathRegex: ${MEDTAGGER__HOST_ON_SUBDIRECTORY}(.*) $$1"
medtagger_backend_rest:
image: medtagger/backend_rest:${MEDTAGGER_VERSION}
restart: unless-stopped
env_file:
- ./backend/docker/backend.env
build:
context: backend
dockerfile: docker/Dockerfile_rest
args:
- CASS_DRIVER_NO_CYTHON=${CASSANDRA_DRIVER__DISABLE_CYTHON}
- CASS_DRIVER_NO_EXTENSIONS=${CASSANDRA_DRIVER__DISABLE_EXTENTIONS}
depends_on:
- cassandra
- rabbitmq
- postgres
- medtagger_backend_websocket
- medtagger_backend_worker
command: bash -c "./scripts/wait_for_dependencies.sh && make run_rest_production"
volumes:
- ${PWD}/.medtagger.yml:/medtagger_backend/.medtagger.yml
labels:
- "traefik.backend=medtagger_backend_rest"
- "traefik.frontend.rule=PathPrefix: ${MEDTAGGER__HOST_ON_SUBDIRECTORY}/api/v1/,${MEDTAGGER__HOST_ON_SUBDIRECTORY}/swaggerui/; ReplacePathRegex: ${MEDTAGGER__HOST_ON_SUBDIRECTORY}(.*) $$1"
medtagger_backend_websocket:
image: medtagger/backend_websocket:${MEDTAGGER_VERSION}
restart: unless-stopped
env_file:
- ./backend/docker/backend.env
build:
context: backend
dockerfile: docker/Dockerfile_websocket
args:
- CASS_DRIVER_NO_CYTHON=${CASSANDRA_DRIVER__DISABLE_CYTHON}
- CASS_DRIVER_NO_EXTENSIONS=${CASSANDRA_DRIVER__DISABLE_EXTENTIONS}
depends_on:
- cassandra
- rabbitmq
- postgres
command: bash -c "./scripts/wait_for_dependencies.sh && make run_websocket_production"
volumes:
- ${PWD}/.medtagger.yml:/medtagger_backend/.medtagger.yml
labels:
- "traefik.backend=medtagger_backend_websocket"
- "traefik.backend.loadbalancer.stickiness=true"
- "traefik.backend.loadbalancer.stickiness.cookieName=MEDTAGER_WEBSOCKET_NODE"
- "traefik.frontend.rule=PathPrefix: ${MEDTAGGER__HOST_ON_SUBDIRECTORY}/socket.io; ReplacePathRegex: ${MEDTAGGER__HOST_ON_SUBDIRECTORY}(.*) $$1"
medtagger_backend_worker:
image: medtagger/backend_worker:${MEDTAGGER_VERSION}
restart: unless-stopped
env_file:
- ./backend/docker/backend.env
build:
context: backend
dockerfile: docker/Dockerfile_worker
args:
- CASS_DRIVER_NO_CYTHON=${CASSANDRA_DRIVER__DISABLE_CYTHON}
- CASS_DRIVER_NO_EXTENSIONS=${CASSANDRA_DRIVER__DISABLE_EXTENTIONS}
depends_on:
- cassandra
- rabbitmq
- postgres
command: bash -c "./scripts/wait_for_dependencies.sh && make run_workers"
volumes:
- ${PWD}/.medtagger.yml:/medtagger_backend/.medtagger.yml
labels:
- "traefik.enable=false"
medtagger_backend_database_migrations:
image: medtagger/backend_database_migrations:${MEDTAGGER_VERSION}
env_file:
- ./backend/docker/backend.env
build:
context: backend
dockerfile: docker/Dockerfile_database_migrations
args:
- CASS_DRIVER_NO_CYTHON=${CASSANDRA_DRIVER__DISABLE_CYTHON}
- CASS_DRIVER_NO_EXTENSIONS=${CASSANDRA_DRIVER__DISABLE_EXTENTIONS}
depends_on:
- cassandra
- rabbitmq
- postgres
command: bash -c "./scripts/dev__prepare_backend.sh"
volumes:
- ${PWD}/.medtagger.yml:/medtagger_backend/.medtagger.yml
labels:
- "traefik.enable=false"
medtagger_jupyter_notebook:
image: medtagger/jupyter_notebook
restart: unless-stopped
ports:
- 52001:52001
env_file:
- ./backend/docker/backend.env
build:
context: backend
dockerfile: docker/Dockerfile_jupyter_notebook
args:
- CASS_DRIVER_NO_CYTHON=${CASSANDRA_DRIVER__DISABLE_CYTHON}
- CASS_DRIVER_NO_EXTENSIONS=${CASSANDRA_DRIVER__DISABLE_EXTENTIONS}
- JUPYTER_NOTEBOOK_PASSWORD=${JUPYTER_NOTEBOOK_PASSWORD}
command: bash -c "cd /medtagger/ && jupyter notebook --ip 0.0.0.0 --port 52001 --no-browser --allow-root"
volumes:
- ${PWD}:/medtagger/
labels:
- "traefik.enable=false"
volumes:
cassandra-data:
rabbitmq-data:
postgres-data: