-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
328 lines (301 loc) · 8.23 KB
/
docker-compose.yml
File metadata and controls
328 lines (301 loc) · 8.23 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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
version: "3.7"
services:
currikiprod1-postgres:
image: "postgres"
container_name: currikiprod1-postgres
restart: unless-stopped
tty: true
ports:
- ${POSTGRES_EXPOSED_PORT}:5432
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
PGDATA: /var/lib/postgresql/data/currikiprod1-postgresdata/
volumes:
- currikiprod1-postgresdata:/var/lib/postgresql/data/currikiprod1-postgresdata/
- ./postgresscripts:/postgresscripts
- ./postgresscripts/setup.sql:/docker-entrypoint-initdb.d/setup.sql:ro
- ./postgresscripts/traxdb.sql:/docker-entrypoint-initdb.d/traxdb.sql:ro
# - ./data/postgres/postgresql.conf:/var/lib/postgresql/data/currikiprod1-postgresdata/abc/postgresql.conf
# currikiprod1-pgadmin:
# image: dpage/pgadmin4:4.18
# container_name: currikiprod1-pgadmin
# restart: always
# environment:
# PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL}
# PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD}
# PGADMIN_LISTEN_PORT: 80
# ports:
# - ${PGADMIN_EXPOSED_PORT}:80
# volumes:
# - pgadmin1-data:/var/lib/pgadmin
# - ./postgresscripts:/postgresscripts
# links:
# - "currikiprod1-postgres:pgsql-server"
# networks:
# - currikiprod1-laravel
currikiprod1-mysql:
image: mysql:5.7.22
container_name: currikiprod1-mysql
restart: unless-stopped
tty: true
volumes:
- currikiprod1-mysqldata:/var/lib/mysql
- ./mysqlscripts/tsugisetup.sql:/docker-entrypoint-initdb.d/tsugisetup.sql:ro
# - ./tmp/database/setup.sql:/docker-entrypoint-initdb.d/setup.sql:ro
# - ./tmp/database/install_db.sql:/docker-entrypoint-initdb.d/init.sql:ro
- ./mysqlscripts:/mysqlscripts
environment:
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
SERVICE_TAGS: dev
SERVICE_NAME: mysql
# command: mysqld --init-file="/tmp/database/install_db.sql"
ports:
- ${MYSQL_LOCAL_PORT}:3306
# currikiprod1-phpmyadmin:
# depends_on:
# - currikiprod1-mysql
# image: phpmyadmin/phpmyadmin
# container_name: currikiprod1-phpmyadmin
# restart: always
# ports:
# - ${PHPMYADMIN_EXPOSED_PORT}:80
# volumes:
# - ./php.ini:/usr/local/etc/php/php.ini
# environment:
# PMA_HOST: currikiprod1-mysql
# MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
# PMA_ABSOLUTE_URI: ${PMA_ABSOLUTE_URI}
# networks:
# - currikiprod1-laravel
currikiprod-nginx:
image: nginx:1.15-alpine
restart: always
container_name: currikiprod-nginx
volumes:
- ./data/nginx/prod-conf:/etc/nginx/conf.d
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
- ./data/nginx/log:/var/log/nginx
ports:
- 80:80
- 443:443
depends_on:
- currikiprod-client
- currikiprod-api
- currikiprod-trax
- currikiprod-tsugi
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
deploy:
replicas: 1
update_config:
parallelism: 2
order: start-first
failure_action: rollback
delay: 10s
rollback_config:
parallelism: 0
order: stop-first
restart_policy:
condition: any
delay: 5s
max_attempts: 3000
window: 120s
certbot:
image: certbot/certbot
restart: unless-stopped
volumes:
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
currikiprod-api:
# build:
# dockerfile: ./Dockerfile
# context: ./api
container_name: currikiprod-api
image: quay.io/curriki/api:${TAG}
ports:
- 9001:80
# - 4003:4003
volumes:
- ./api/storage:/var/www/html/storage
- ./api/.env:/var/www/html/.env
restart: always
deploy:
replicas: 2
update_config:
parallelism: 2
order: start-first
failure_action: rollback
delay: 10s
rollback_config:
parallelism: 0
order: stop-first
restart_policy:
condition: any
delay: 5s
max_attempts: 3
window: 120s
healthcheck:
test: sh -c "[ -f /var/www/html/health.ok ]"
interval: 10s
timeout: 3s
start_period: 10s
retries: 30
currikiprod-cron:
# build:
# dockerfile: ./Dockerfile
# context: ./api
container_name: currikiprod-cron
image: quay.io/curriki/cron:${TAG}
# ports:
# - 4003:4003
volumes:
- ./api/storage:/var/www/html/storage
- ./api/.env:/var/www/html/.env
restart: always
deploy:
replicas: 1
update_config:
parallelism: 2
order: start-first
failure_action: rollback
delay: 10s
rollback_config:
parallelism: 0
order: stop-first
restart_policy:
condition: any
delay: 5s
max_attempts: 3
window: 120s
healthcheck:
test: sh -c "[ -f /var/www/html/health.ok ]"
interval: 10s
timeout: 3s
start_period: 10s
retries: 30
currikiprod-client:
# build:
# dockerfile: ./Dockerfile
# context: ./client
image: quay.io/curriki/client:${TAG}
container_name: currikiprod-client
volumes:
- ./client/.env.local:/app/.env.local
- ./client/.env:/usr/share/nginx/html/.env
restart: always
env_file:
- ./client/.env
ports:
- 3000:80
deploy:
replicas: 1
update_config:
parallelism: 2
order: start-first
failure_action: rollback
delay: 10s
rollback_config:
parallelism: 0
order: stop-first
restart_policy:
condition: any
delay: 5s
max_attempts: 120
window: 120s
healthcheck:
test: sh -c "[ -f /usr/share/nginx/html/health.ok ]"
interval: 10s
timeout: 3s
start_period: 30s
retries: 30
currikiprod-trax:
build:
dockerfile: ./Dockerfile
context: ./trax-lrs
image: quay.io/curriki/trax:latest
container_name: currikiprod-trax
ports:
- 6900:6900
volumes:
- ./trax-lrs/storage:/var/www/html/storage
- ./trax-lrs/.env:/var/www/html/.env
restart: always
deploy:
replicas: 1
update_config:
parallelism: 2
order: start-first
failure_action: rollback
delay: 10s
rollback_config:
parallelism: 0
order: stop-first
restart_policy:
condition: any
delay: 5s
max_attempts: 3
window: 120s
healthcheck:
test: sh -c "[ -f /var/www/html/health.ok ]"
interval: 10s
timeout: 3s
start_period: 10s
retries: 30
currikiprod-tsugi:
build:
dockerfile: ./Dockerfile
context: ./tsugi
image: quay.io/curriki/tsugi:${TAG}
container_name: currikiprod-tsugi
ports:
- 6300:80
volumes:
- ./tsugi/config.php:/var/www/html/tsugi/config.php
- ./tsugi/mod/curriki/config.php:/var/www/html/tsugi/mod/curriki/config.php
restart: always
deploy:
replicas: 1
update_config:
parallelism: 2
order: start-first
failure_action: rollback
delay: 10s
rollback_config:
parallelism: 0
order: stop-first
restart_policy:
condition: any
delay: 5s
max_attempts: 3
window: 120s
healthcheck:
test: sh -c "[ -f /var/www/html/tsugi/health.ok ]"
interval: 10s
timeout: 3s
start_period: 10s
retries: 30
volumes: #provide volume
currikiprod1-mysqldata:
driver: local
driver_opts:
o: bind
type: none
device: /mnt/DBData/currikiprod1-mysqldata
currikiprod1-postgresdata:
driver: local
driver_opts:
o: bind
type: none
device: /mnt/DBData/currikiprod1-postgresdata
pgadmin1-data:
driver: local
driver_opts:
o: bind
type: none
device: /mnt/DBData/pgadmin1-data