-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathswarm.yaml
397 lines (363 loc) · 9.24 KB
/
swarm.yaml
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
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
version: '3.5'
x-env:
&env
APP_ENV: production
APP_DEBUG: "false"
APP_KEY_FILE: /run/secrets/APP_KEY_FILE
APP_URL: https://4programmers.net
API_HOST: api.4programmers.net
SESSION_DOMAIN: ".4programmers.net"
DB_CONNECTION: pgsql
DB_PORT: 5432
DB_HOST: db
DB_DATABASE: coyote
DB_USERNAME: coyote
DB_PASSWORD_FILE: /run/secrets/POSTGRES_PASSWORD_FILE
ELASTICSEARCH_HOST: elasticsearch
REDIS_HOST: redis
BROADCAST_DRIVER: redis
CACHE_DRIVER: redis
QUEUE_DRIVER: redis
LOG_CHANNEL: gelf
AWS_ACCESS_KEY_ID_FILE: /run/secrets/AWS_ACCESS_KEY_ID_FILE
AWS_SECRET_ACCESS_KEY_FILE: /run/secrets/AWS_SECRET_ACCESS_KEY_FILE
AWS_URL: https://4programmers.net/uploads/
MINIO_ENDPOINT: http://minio:9000/
WS_HOST: ws.4programmers.net
MAIL_DRIVER: mailgun
MAILGUN_DOMAIN: mg.4programmers.net
MAILGUN_SECRET_FILE: /run/secrets/MAILGUN_SECRET_FILE
SENTRY_DSN_FILE: /run/secrets/SENTRY_DSN_FILE
RECAPTCHA_KEY_FILE: /run/secrets/RECAPTCHA_KEY_FILE
RECAPTCHA_SECRET_FILE: /run/secrets/RECAPTCHA_SECRET_FILE
P24_CLIENT_ID_FILE: /run/secrets/P24_CLIENT_ID_FILE
P24_SALT_FILE: /run/secrets/P24_SALT_FILE
P24_PAYMENT_URL: "https://secure.przelewy24.pl/trnDirect"
P24_VERIFY_URL: "https://secure.przelewy24.pl/trnVerify"
PAYLANE_USERNAME_FILE: /run/secrets/PAYLANE_USERNAME_FILE
PAYLANE_PASSWORD_FILE: /run/secrets/PAYLANE_PASSWORD_FILE
PAYLANE_SALT_FILE: /run/secrets/PAYLANE_SALT_FILE
STRIPE_KEY_FILE: /run/secrets/STRIPE_KEY_FILE
STRIPE_SECRET_FILE: /run/secrets/STRIPE_SECRET_FILE
STRIPE_ENDPOINT_SECRET_FILE: /run/secrets/STRIPE_ENDPOINT_SECRET_FILE
GITHUB_CLIENT_ID_FILE: /run/secrets/GITHUB_CLIENT_ID_FILE
GITHUB_SECRET_ID_FILE: /run/secrets/GITHUB_SECRET_ID_FILE
GITHUB_REDIRECT: "https://4programmers.net/OAuth/Github/Callback"
GOOGLE_CLIENT_ID_FILE: /run/secrets/GOOGLE_CLIENT_ID_FILE
GOOGLE_SECRET_ID_FILE: /run/secrets/GOOGLE_SECRET_ID_FILE
GOOGLE_MAPS_KEY_FILE: /run/secrets/GOOGLE_MAPS_KEY_FILE
GOOGLE_REDIRECT: "https://4programmers.net/OAuth/Google/Callback"
FACEBOOK_CLIENT_ID_FILE: /run/secrets/FACEBOOK_CLIENT_ID_FILE
FACEBOOK_SECRET_ID_FILE: /run/secrets/FACEBOOK_SECRET_ID_FILE
FACEBOOK_REDIRECT: "https://4programmers.net/OAuth/Facebook/Callback"
VAPID_PUBLIC_KEY_FILE: /run/secrets/VAPID_PUBLIC_KEY_FILE
VAPID_PRIVATE_KEY_FILE: /run/secrets/VAPID_PRIVATE_KEY_FILE
VENDOR_NAME: "Makana Sp. z o.o."
VENDOR_ADDRESS: "ul. Krupnicza 13"
VENDOR_POSTAL_CODE: "50-075"
VENDOR_CITY: "Wrocław"
VENDOR_COUNTRY: "Polska"
x-secrets:
&secrets
- APP_KEY_FILE
- POSTGRES_PASSWORD_FILE
- AWS_ACCESS_KEY_ID_FILE
- AWS_SECRET_ACCESS_KEY_FILE
- AWS_URL_FILE
- MAILGUN_SECRET_FILE
- SENTRY_DSN_FILE
- RECAPTCHA_KEY_FILE
- RECAPTCHA_SECRET_FILE
- P24_CLIENT_ID_FILE
- P24_SALT_FILE
- PAYLANE_USERNAME_FILE
- PAYLANE_PASSWORD_FILE
- PAYLANE_SALT_FILE
- GITHUB_CLIENT_ID_FILE
- GITHUB_SECRET_ID_FILE
- GOOGLE_CLIENT_ID_FILE
- GOOGLE_SECRET_ID_FILE
- GOOGLE_MAPS_KEY_FILE
- FACEBOOK_CLIENT_ID_FILE
- FACEBOOK_SECRET_ID_FILE
- STRIPE_KEY_FILE
- STRIPE_SECRET_FILE
- STRIPE_ENDPOINT_SECRET_FILE
- VAPID_PUBLIC_KEY_FILE
- VAPID_PRIVATE_KEY_FILE
services:
db:
image: postgres:13-alpine
ports:
- 5432:5432
volumes:
- ./docker/postgres/postgresql.prod.conf:/var/lib/postgresql/data/postgresql.auto.conf
- postgres:/var/lib/postgresql/data:z
environment:
POSTGRES_USER: coyote
POSTGRES_PASSWORD_FILE: /run/secrets/POSTGRES_PASSWORD_FILE
POSTGRES_DB: coyote
networks:
- coyote
secrets:
- POSTGRES_PASSWORD_FILE
logging:
driver: "json-file"
options:
tag: postgres
max-size: 10m
php:
image: 4programmers/coyote:latest
build:
context: .
dockerfile: docker/coyote/Dockerfile
cache_from:
- 4programmers/coyote:latest
volumes:
- codebase:/var/www
environment:
<<: *env
DB_MIGRATE: "true"
secrets: *secrets
deploy:
replicas: 2
healthcheck:
test: [ "CMD", "php", "artisan", "help" ]
interval: 5s
timeout: 10s
retries: 3
networks:
- coyote
logging:
driver: "json-file"
options:
tag: php
max-size: 10m
worker:
image: 4programmers/coyote:latest
networks:
- coyote
command: php artisan queue:work --delay=5 --tries=3 -n redis
deploy:
replicas: 2
environment: *env
secrets: *secrets
logging:
driver: "json-file"
options:
tag: worker
max-size: 10m
cron:
image: 4programmers/coyote:latest
entrypoint: cron -f -l 8
environment: *env
secrets: *secrets
volumes:
- codebase:/var/www
networks:
- coyote
logging:
driver: "json-file"
options:
tag: cron
max-size: 10m
nginx:
image: nginx:1.17
volumes:
- codebase:/var/www/
- ./docker/nginx/:/etc/nginx/conf.d/
ports:
- 80:80
depends_on:
- php
networks:
- coyote
logging:
driver: "json-file"
options:
tag: nginx
max-size: 10m
redis:
image: redis:6-alpine
command: redis-server --appendonly no --save
networks:
- coyote
elasticsearch:
image: elasticsearch:6.8.6
volumes:
- elasticsearch6:/usr/share/elasticsearch/data
environment:
- "discovery.type=single-node"
- "ES_JAVA_OPTS=-Xms2g -Xmx2g"
networks:
- coyote
logging:
driver: "json-file"
options:
tag: elasticsearch
max-size: 10m
minio:
image: minio/minio:RELEASE.2020-01-03T19-12-21Z
volumes:
- minio:/data
environment:
- MINIO_ACCESS_KEY_FILE=AWS_ACCESS_KEY_ID_FILE
- MINIO_SECRET_KEY_FILE=AWS_SECRET_ACCESS_KEY_FILE
command: server /data
secrets:
- AWS_ACCESS_KEY_ID_FILE
- AWS_SECRET_ACCESS_KEY_FILE
networks:
- coyote
deploy:
restart_policy:
delay: 10s
max_attempts: 10
window: 60s
ports:
- 39000:9000
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
logging:
driver: "json-file"
options:
tag: minio
max-size: 10m
mongo:
image: mongo:3
volumes:
- mongo:/data/db
networks:
- coyote
graylog:
image: graylog/graylog:3.1
environment:
- GRAYLOG_PASSWORD_SECRET_FILE=/run/secrets/GRAYLOG_PASSWORD_SECRET_FILE
# - GRAYLOG_ROOT_PASSWORD_SHA2=8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918
- GRAYLOG_ROOT_PASSWORD_SHA2__FILE=/run/secrets/GRAYLOG_ROOT_PASSWORD_SHA2_FILE
- GRAYLOG_HTTP_EXTERNAL_URI=https://graylog.4programmers.dev/
networks:
- coyote
depends_on:
- mongo
- elasticsearch
secrets:
- GRAYLOG_ROOT_PASSWORD_SHA2_FILE
- GRAYLOG_PASSWORD_SECRET_FILE
ports:
- 12201:12201
- 12201:12201/udp
fluentbit:
image: fluent/fluent-bit:1.3-debug
volumes:
- ./docker/fluent-bit/fluent-bit.conf:/fluent-bit/etc/fluent-bit.conf
- /var/lib/docker/containers:/var/log/containers
networks:
- coyote
websocket:
image: 4programmers/websocket:latest
networks:
- coyote
tty: true
environment:
PORT: "8888"
REDIS_HOST: "redis"
secrets:
- APP_KEY_FILE
logging:
driver: "json-file"
options:
tag: websocket
max-size: 10m
es:
image: 4programmers/coyote-es:latest
networks:
- coyote
tty: true
environment:
PORT: "3500"
ELASTICSEARCH_HOST: "elasticsearch"
INDEX: "coyote"
APP_KEY_FILE: /run/secrets/APP_KEY_FILE
# healthcheck:
# test: ["CMD", "curl", "-f", "http://localhost:3500/healtcheck || exit 1"]
# interval: 30s
# timeout: 20s
# retries: 3
secrets:
- APP_KEY_FILE
logging:
driver: "json-file"
options:
tag: node-es
max-size: 10m
volumes:
postgres:
elasticsearch6:
minio:
codebase:
mongo:
graylog:
networks:
coyote:
name: coyote
secrets:
APP_KEY_FILE:
external: true
AWS_ACCESS_KEY_ID_FILE:
external: true
AWS_SECRET_ACCESS_KEY_FILE:
external: true
POSTGRES_PASSWORD_FILE:
external: true
AWS_URL_FILE:
external: true
WS_PROXY_FILE:
external: true
MAILGUN_SECRET_FILE:
external: true
SENTRY_DSN_FILE:
external: true
RECAPTCHA_KEY_FILE:
external: true
RECAPTCHA_SECRET_FILE:
external: true
P24_CLIENT_ID_FILE:
external: true
P24_SALT_FILE:
external: true
PAYLANE_USERNAME_FILE:
external: true
PAYLANE_PASSWORD_FILE:
external: true
PAYLANE_SALT_FILE:
external: true
GITHUB_CLIENT_ID_FILE:
external: true
GITHUB_SECRET_ID_FILE:
external: true
GOOGLE_CLIENT_ID_FILE:
external: true
GOOGLE_SECRET_ID_FILE:
external: true
FACEBOOK_CLIENT_ID_FILE:
external: true
FACEBOOK_SECRET_ID_FILE:
external: true
GRAYLOG_ROOT_PASSWORD_SHA2_FILE:
external: true
GRAYLOG_PASSWORD_SECRET_FILE:
external: true
STRIPE_KEY_FILE:
external: true
STRIPE_SECRET_FILE:
external: true
STRIPE_ENDPOINT_SECRET_FILE:
external: true
VAPID_PUBLIC_KEY_FILE:
external: true
VAPID_PRIVATE_KEY_FILE:
external: true