-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
262 lines (242 loc) · 6.87 KB
/
Copy pathdocker-compose.yml
File metadata and controls
262 lines (242 loc) · 6.87 KB
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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
services:
nginx:
image: nginx
restart: always
volumes:
- ./nginx/conf/main-domain.conf.template:/etc/nginx/templates/main-domain.conf.template
- ./nginx/conf/auth-domain.conf.template:/etc/nginx/templates/auth-domain.conf.template
- ./nginx/conf/default.conf:/etc/nginx/conf.d/default.conf:ro
- ./nginx/www:/var/www:ro
- ./nginx/ssl:/etc/letsencrypt
env_file:
- .env
depends_on:
- core
- workflow
- vue-portal
- portal
- workflow-portal
- finmars-start-page
- pdfgen
- excelgen
- keycloak
ports:
- "80:80"
- "443:443"
- "${AUTH_DOMAIN_PORT}:${AUTH_DOMAIN_PORT}"
certbot:
image: certbot/certbot
volumes:
- ./nginx/ssl:/etc/letsencrypt
env_file:
- .env
ports:
- "80:80"
command: [
"certonly",
"--standalone",
"--non-interactive",
"--agree-tos",
"-d", "${MAIN_DOMAIN_NAME}",
"-d", "${AUTH_DOMAIN_NAME}"
]
keycloak:
image: quay.io/keycloak/keycloak:24.0.3
restart: always
command: start --import-realm
volumes:
- ./keycloak/config/keycloak.conf:/opt/keycloak/conf/keycloak.conf:ro
- ./nginx/ssl:/etc/letsencrypt
- ./keycloak/themes/finmars:/opt/keycloak/themes/finmars
- ./keycloak/data/:/opt/keycloak/data/import
env_file:
- .env
environment:
- KC_DB=postgres
- KC_BOOTSTRAP_ADMIN_USERNAME=${ADMIN_USERNAME}
- KC_BOOTSTRAP_ADMIN_PASSWORD=${ADMIN_PASSWORD}
- KEYCLOAK_ADMIN=${ADMIN_USERNAME}
- KEYCLOAK_ADMIN_PASSWORD=${ADMIN_PASSWORD}
- KEYCLOAK_IMPORT=/opt/keycloak/data/import
depends_on:
db_keycloak:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "exec 3<>/dev/tcp/127.0.0.1/8080;echo -e \"GET /health/ready HTTP/1.1\r\nhost: http://localhost\r\nConnection: close\r\n\r\n\" >&3;grep \"HTTP/1.1 200 OK\" <&3"]
interval: 10s
timeout: 5s
retries: 5
start_period: 60s
core: &core-base
image: finmars/finmars-core:${CORE_IMAGE_VERSION}
platform: linux/amd64
restart: always
volumes:
- storage:/var/app/finmars_data
env_file:
- .env
environment:
- DB_NAME=backend_realm00000
- DJANGO_SETTINGS_MODULE=poms_app.settings
- SENTRY_DSN=https://037aa6153e3acdd13726f04512706758@sentry.finmars.com/2
depends_on:
core-migration:
condition: service_completed_successfully
db:
condition: service_healthy
rabbitmq:
condition: service_started
redis:
condition: service_started
keycloak:
condition: service_healthy
core-worker:
<<: *core-base
command: >
sh -c "celery --app poms_app worker --concurrency=1 --loglevel=INFO -n $CORE_WORKER_NAME -Q $CORE_QUEUES --max-tasks-per-child=1"
core-migration:
<<: *core-base
restart: "no"
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
command: ["python", "/var/app/manage.py", "migrate_all_schemes"]
workflow: &workflow-base
image: finmars/finmars-workflow:${WORKFLOW_IMAGE_VERSION}
platform: linux/amd64
restart: always
volumes:
- storage:/var/app/finmars_data
env_file:
- .env
environment:
- DB_NAME=workflow_realm00000
- DJANGO_SETTINGS_MODULE=workflow_app.settings
depends_on:
workflow-migration:
condition: service_completed_successfully
db:
condition: service_healthy
rabbitmq:
condition: service_started
redis:
condition: service_started
keycloak:
condition: service_healthy
workflow-worker:
<<: *workflow-base
command: >
sh -c "celery --app workflow_app worker --concurrency=1 --loglevel=INFO -n $WORKFLOW_WORKER_NAME -Q $WORKFLOW_QUEUES --max-tasks-per-child=1"
workflow-scheduler:
<<: *workflow-base
command: >
sh -c "celery --app workflow_app beat --loglevel=INFO --scheduler workflow.schedulers:DatabaseScheduler --pidfile=/tmp/celerybeat.pid"
workflow-migration:
<<: *workflow-base
restart: "no"
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
command: ["python", "/var/app/manage.py", "migrate_all_schemes"]
workflow-flower:
<<: *workflow-base
command: >
sh -c "celery --app workflow_app flower --url_prefix=$REALM_CODE/workflow/flower --broker={CELERY_BROKER_URL} --basic_auth=${ADMIN_USERNAME}:${ADMIN_PASSWORD}"
pdfgen:
platform: linux/amd64
image: finmars/finmars-pdfgen:latest
restart: always
excelgen:
platform: linux/amd64
image: finmars/finmars-excelgen:latest
restart: always
finmars-start-page:
platform: linux/amd64
image: finmars/finmars-start-page:latest
restart: always
env_file:
- .env
portal:
platform: linux/amd64
image: finmars/finmars-portal:${PORTAL_IMAGE_VERSION}
restart: always
env_file:
- .env
vue-portal:
platform: linux/amd64
image: finmars/finmars-vue-portal:${VUE_PORTAL_IMAGE_VERSION}
restart: always
environment:
- NUXT_APP_BUILD_ASSETS_DIR=/realm00000/v/_nuxt/
env_file:
- .env
workflow-portal:
platform: linux/amd64
image: finmars/finmars-workflow-portal:${WORKFLOW_PORTAL_IMAGE_VERSION}
restart: always
environment:
- NUXT_APP_BUILD_ASSETS_DIR=/realm00000/w/_nuxt/
env_file:
- .env
db:
image: postgres:13-alpine
restart: always
env_file:
- .env
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=${DB_NAME}
stdin_open: true
tty: true
volumes:
- postgres_data:/var/lib/postgresql/data
- ./db/init:/docker-entrypoint-initdb.d
healthcheck:
test: ["CMD", "pg_isready", "-U", "${DB_USER}", "-d", "${DB_NAME}"]
interval: 10s
retries: 5
start_period: 15s
timeout: 10s
db_keycloak:
image: postgres:13-alpine
restart: always
environment:
- POSTGRES_DB=${KC_DB_URL_DATABASE}
- POSTGRES_USER=${KC_DB_USERNAME}
- POSTGRES_PASSWORD=${KC_DB_PASSWORD}
stdin_open: true
tty: true
volumes:
- postgres_data_keycloak:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready", "-U", "${KC_DB_USERNAME}", "-d", "${KC_DB_URL_DATABASE}"]
interval: 10s
retries: 5
start_period: 15s
timeout: 10s
rabbitmq:
image: rabbitmq:3.11.3-management
restart: always
env_file:
- .env
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_USER}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASSWORD}
stdin_open: true
tty: true
volumes:
- ./rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf
redis:
image: redis
restart: always
stdin_open: true
tty: true
volumes:
postgres_data:
postgres_data_keycloak:
storage: