-
Notifications
You must be signed in to change notification settings - Fork 7
/
docker-compose.yml
282 lines (267 loc) · 9.08 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
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
services:
traefik:
image: traefik:2.11
command:
--providers.docker=true
--providers.docker.exposedbydefault=false
--entrypoints.http.address=:80
ports:
- "80:80"
networks:
- traefik-public
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
labels:
- traefik.enable=true
- traefik.docker.network=traefik-public
site:
image: ${REGISTRY:-localhost}/site-dev:cache
build:
context: ./docker
dockerfile: development/nginx/Dockerfile
cache_from:
- ${REGISTRY:-localhost}/site-dev:cache
cache_to:
- type=inline
networks:
- traefik-public
- default
volumes:
- ./:/app
labels:
- traefik.enable=true
- traefik.docker.network=traefik-public
- traefik.http.routers.site.rule=Host(`localhost`)
- traefik.http.routers.site.entrypoints=http
- traefik.http.services.site.loadbalancer.server.port=80
site-php-fpm:
image: ${REGISTRY:-localhost}/site-dev-php-fpm:cache
build:
context: ./docker
dockerfile: development/php-fpm/Dockerfile
cache_from:
- ${REGISTRY:-localhost}/site-dev-php-fpm:cache
cache_to:
- type=inline
environment:
PHP_IDE_CONFIG: serverName=SITE
APP_DEBUG: 1
APP_ENV: dev
APP_URL: http://localhost
APP_CAPTCHA_CODE: 42
COOKIE_SECRET_FILE: /run/secrets/cookie_secret
DB_HOST: site-mysql
DB_NAME: app
DB_USERNAME: app
DB_PASSWORD_FILE: /run/secrets/db_password
REDIS_HOST: site-redis
REDIS_PASSWORD_FILE: /run/secrets/redis_password
MAILER_HOST: site-mailer
MAILER_PORT: 1025
MAILER_USERNAME: app
MAILER_PASSWORD_FILE: /run/secrets/mailer_password
MAILER_FROM_EMAIL: [email protected]
DEWORKER_API_URL: http://site-wiremock/api.deworker.pro
SENTRY_DSN_FILE: /run/secrets/sentry_dsn
volumes:
- ./:/app
secrets:
- cookie_secret
- db_password
- redis_password
- mailer_password
- sentry_dsn
site-php-cli:
image: ${REGISTRY:-localhost}/site-dev-php-cli:cache
build:
context: ./docker
dockerfile: development/php-cli/Dockerfile
cache_from:
- ${REGISTRY:-localhost}/site-dev-php-cli:cache
cache_to:
- type=inline
environment:
APP_DEBUG: 1
APP_ENV: dev
APP_URL: http://localhost
COOKIE_SECRET_FILE: /run/secrets/cookie_secret
DB_HOST: site-mysql
DB_NAME: app
DB_USERNAME: app
DB_PASSWORD_FILE: /run/secrets/db_password
REDIS_HOST: site-redis
REDIS_PASSWORD_FILE: /run/secrets/redis_password
MAILER_HOST: site-mailer
MAILER_PORT: 1025
MAILER_USERNAME: app
MAILER_PASSWORD_FILE: /run/secrets/mailer_password
MAILER_FROM_EMAIL: [email protected]
DEWORKER_API_URL: http://site-wiremock/api.deworker.pro
SENTRY_DSN_FILE: /run/secrets/sentry_dsn
volumes:
- ./:/app
secrets:
- cookie_secret
- db_password
- redis_password
- mailer_password
- sentry_dsn
network_mode: service:site
site-node-watch:
image: node:22-alpine
user: "1000:1000"
volumes:
- ./:/app
working_dir: /app
command: sh -c 'until [ -f .ready ] ; do sleep 1 ; done && npm run watch'
site-node-cli:
image: node:22-alpine
user: "1000:1000"
volumes:
- ./:/app
working_dir: /app
site-mysql:
image: mariadb:11
volumes:
- site-mysql:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/db_root_password
MYSQL_USER: app
MYSQL_PASSWORD_FILE: /run/secrets/db_password
MYSQL_DATABASE: app
secrets:
- db_root_password
- db_password
ports:
- "3306:3306"
site-mysql-backup:
image: ${REGISTRY:-localhost}/site-dev-mysql-backup:cache
build:
context: ./docker/common
dockerfile: mysql-backup/Dockerfile
cache_from:
- ${REGISTRY:-localhost}/site-dev-mysql-backup:cache
cache_to:
- type=inline
environment:
BACKUP_NAME: site-mysql
MYSQL_HOST: site-mysql
MYSQL_USER: app
MYSQL_PASSWORD_FILE: /run/secrets/db_password
MYSQL_DB: app
AWS_ACCESS_KEY_ID: app
AWS_SECRET_ACCESS_KEY_FILE: /run/secrets/backup_aws_secret_access_key
AWS_DEFAULT_REGION: region
S3_ENDPOINT: http://site-backup-storage:9000
S3_BUCKET: backup
secrets:
- db_password
- backup_aws_secret_access_key
command: sh -c 'wait-for-it site-mysql:3306 -t 20 && backup'
site-upload-backup:
image: ${REGISTRY:-localhost}/site-dev-files-backup:cache
build:
context: ./docker/common/files-backup
cache_from:
- ${REGISTRY:-localhost}/site-dev-files-backup:cache
cache_to:
- type=inline
environment:
BACKUP_NAME: site-upload
TARGET: /upload
AWS_ACCESS_KEY_ID: app
AWS_SECRET_ACCESS_KEY_FILE: /run/secrets/backup_aws_secret_access_key
AWS_DEFAULT_REGION: region
S3_ENDPOINT: http://site-backup-storage:9000
S3_BUCKET: backup
secrets:
- backup_aws_secret_access_key
volumes:
- ./public/upload:/upload:ro
site-redis:
image: ${REGISTRY:-localhost}/site-dev-redis:cache
build:
context: ./docker/common/redis
cache_from:
- ${REGISTRY:-localhost}/site-dev-redis:cache`
cache_to:
- type=inline
environment:
REDIS_PASSWORD_FILE: /run/secrets/redis_password
secrets:
- redis_password
volumes:
- site-redis:/data
command:
- 'redis-server'
- '--maxmemory 32mb'
- '--maxmemory-policy allkeys-lru'
site-mailer:
image: mailhog/mailhog
networks:
- traefik-public
- default
labels:
- traefik.enable=true
- traefik.docker.network=traefik-public
- traefik.http.routers.site-mailer.rule=Host(`mailer.localhost`)
- traefik.http.routers.site-mailer.entrypoints=http
- traefik.http.services.site-mailer.loadbalancer.server.port=8025
site-backup-storage:
image: minio/minio
environment:
MINIO_ROOT_USER: app
MINIO_ROOT_PASSWORD_FILE: /run/secrets/backup_aws_secret_access_key
secrets:
- backup_aws_secret_access_key
networks:
- traefik-public
- default
volumes:
- site-backup-storage:/data
entrypoint: sh -c 'mkdir -p /data/backup && docker-entrypoint.sh minio server /data --console-address ":80"'
labels:
- traefik.enable=true
- traefik.docker.network=traefik-public
- traefik.http.routers.site-backup-storage.rule=Host(`backup-storage.localhost`)
- traefik.http.routers.site-backup-storage.entrypoints=http
- traefik.http.services.site-backup-storage.loadbalancer.server.port=80
site-wiremock:
image: wiremock/wiremock:latest-alpine
networks:
- traefik-public
- default
volumes:
- ./wiremock:/home/wiremock
command:
- '--port=80'
- '--global-response-templating'
- '--verbose'
labels:
- traefik.enable=true
- traefik.docker.network=traefik-public
- traefik.http.routers.site-wiremock.rule=Host(`wiremock.localhost`)
- traefik.http.routers.site-wiremock.entrypoints=http
- traefik.http.services.site-wiremock.loadbalancer.server.port=80
secrets:
cookie_secret:
file: ./secrets/cookie_secret
db_password:
file: ./secrets/db_password
db_root_password:
file: ./secrets/db_root_password
redis_password:
file: ./secrets/redis_password
mailer_password:
file: ./secrets/mailer_password
sentry_dsn:
file: ./secrets/sentry_dsn
backup_aws_secret_access_key:
file: ./secrets/backup_aws_secret_access_key
volumes:
site-mysql:
site-redis:
site-backup-storage:
networks:
traefik-public:
name: traefik-public