-
Notifications
You must be signed in to change notification settings - Fork 8
/
docker-compose.yaml
322 lines (307 loc) · 10.1 KB
/
docker-compose.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
# This file is used to run your application locally with Docker Compose
version: "3.8"
services:
full-stack-template-ingress:
container_name: full-stack-template-ingress
image: nginx:stable-alpine
restart: unless-stopped
networks:
- default
ports:
# WARNING: Do not ever remove the 127.0.0.1 as on some systems Docker host ports are exposed outside the Firewall!
- "127.0.0.1:9999:80"
volumes:
- "./docker-nginx.conf:/etc/nginx/nginx.conf:delegated"
full-stack-template-admin:
container_name: full-stack-template-admin
build:
context: ./admin
dockerfile: ${dockerfile}
args:
USER_UID: ${taito_host_user_uid}
restart: unless-stopped
networks:
- default
ports:
- "8080"
# WARNING: Do not ever remove the 127.0.0.1 as on some systems Docker host ports are exposed outside the Firewall!
- "127.0.0.1:9997:9997" # For lazy compilation
volumes:
- "./admin:/develop:delegated"
- "./shared:/develop/shared:delegated"
- "/develop/node_modules"
- "/develop/.vite"
environment:
# Paths
BASE_PATH: /admin
REPLACE_BASE_PATH: /admin # For Dockerfile.build
ASSETS_PATH: /admin
REPLACE_ASSETS_PATH: /admin # For Dockerfile.build
ASSETS_DOMAIN: ""
REPLACE_ASSETS_DOMAIN: "" # For Dockerfile.build
API_ROOT: ""
API_URL: /api
COMMON_PUBLIC_PORT: 9999
COMPILE_PORT: 9997 # For lazy compilation
# Host specific variables
DOCKER_HOST: ${DOCKER_HOST}
full-stack-template-client:
container_name: full-stack-template-client
build:
context: ./client
dockerfile: ${dockerfile}
args:
USER_UID: ${taito_host_user_uid}
restart: unless-stopped
networks:
- default
ports:
- "8080"
volumes:
- "./client:/develop:delegated"
- "./shared:/develop/shared:delegated"
- "/develop/node_modules"
- "/develop/.vite"
secrets:
- DATABASE_PASSWORD
environment:
# Paths
BASE_PATH: ""
REPLACE_BASE_PATH: "" # For Dockerfile.build
ASSETS_PATH: ""
REPLACE_ASSETS_PATH: "" # For Dockerfile.build
ASSETS_DOMAIN: ""
REPLACE_ASSETS_DOMAIN: "" # For Dockerfile.build
API_ROOT: ""
API_URL: /api
COMMON_PUBLIC_PORT: 9999
COMPILE_PORT: 9998 # For lazy compilation
# Host specific variables
DOCKER_HOST: ${DOCKER_HOST}
# Services
# NOTE: Database connection is for tests only
DATABASE_HOST: full-stack-template-database
DATABASE_PORT: ${db_database_port}
DATABASE_NAME: ${db_database_name}
DATABASE_USER: ${db_database_app_username}
full-stack-template-server:
container_name: full-stack-template-server
build:
context: ./server
dockerfile: ${dockerfile}
args:
USER_UID: ${taito_host_user_uid}
restart: unless-stopped
networks:
- default
ports:
- "8080"
# WARNING: Do not ever remove the 127.0.0.1 as on some systems Docker host ports are exposed outside the Firewall!
- "127.0.0.1:4229:9229"
volumes:
- "./server:/develop:delegated"
- "./shared:/develop/shared:delegated"
- "/develop/node_modules"
- "/develop/vendor"
secrets:
- DATABASE_PASSWORD
- REDIS_PASSWORD
- SESSION_SECRET
- EXAMPLE_SECRET
environment:
# Paths and bind
BASE_PATH: /api
API_PORT: 8080
API_BINDADDR: 0.0.0.0
COMMON_PUBLIC_PORT: 9999
# Common variables
COMMON_COMPANY: companyname
COMMON_PROJECT: full-stack-template
COMMON_DEBUG: "false"
COMMON_LOG_FORMAT: text
COMMON_LOG_LEVEL: info # trace, debug, info, warn, error, fatal
COMMON_ENV: local
COMMON_URL: http://localhost:9999
# Services
SENTRY_DSN: #sentryDSN
DATABASE_HOST: full-stack-template-database
DATABASE_PORT: ${db_database_port}
DATABASE_NAME: ${db_database_name}
DATABASE_USER: ${db_database_app_username}
DATABASE_POOL_MIN: "1"
DATABASE_POOL_MAX: "10"
DATABASE_SSL_ENABLED: "${db_database_ssl_enabled}"
DATABASE_SSL_CLIENT_CERT_ENABLED: "${db_database_ssl_client_cert_enabled}"
DATABASE_SSL_SERVER_CERT_ENABLED: "${db_database_ssl_server_cert_enabled}"
REDIS_HOST: full-stack-template-redis
REDIS_PORT: 6379
BUCKET_BUCKET: bucket
BUCKET_REGION: milkyway
BUCKET_ENDPOINT: http://full-stack-template-storage:9000/
BUCKET_FORCE_PATH_STYLE: "true"
BUCKET_KEY_ID: minio
BUCKET_KEY_SECRET: ${taito_default_password}
# Enable api docs and GraphQL/Swagger playground in local environment
API_DOCS_ENABLED: true
API_PLAYGROUND_ENABLED: true
full-stack-template-worker:
container_name: full-stack-template-worker
build:
context: ./worker
dockerfile: ${dockerfile}
args:
USER_UID: ${taito_host_user_uid}
tty: true
restart: unless-stopped
networks:
- default
ports:
- "8080"
# WARNING: Do not ever remove the 127.0.0.1 as on some systems Docker host ports are exposed outside the Firewall!
- "127.0.0.1:5229:9229"
volumes:
- "./worker:/develop:delegated"
- "./shared:/develop/shared:delegated"
- "/develop/node_modules"
secrets:
- DATABASE_PASSWORD
- REDIS_PASSWORD
- EXAMPLE_SECRET
environment:
# Paths and bind
API_PORT: 8080
API_BINDADDR: 0.0.0.0
COMMON_PUBLIC_PORT: 9999
# Common variables
COMMON_COMPANY: companyname
COMMON_PROJECT: full-stack-template
COMMON_DEBUG: "false"
COMMON_LOG_FORMAT: text
COMMON_LOG_LEVEL: info # trace, debug, info, warn, error, fatal
COMMON_ENV: local
COMMON_DOMAIN: localhost
# Services
SENTRY_DSN: #sentryDSN
DATABASE_HOST: full-stack-template-database
DATABASE_PORT: ${db_database_port}
DATABASE_NAME: ${db_database_name}
DATABASE_USER: ${db_database_app_username}
DATABASE_POOL_MIN: "1"
DATABASE_POOL_MAX: "10"
DATABASE_SSL_ENABLED: "${db_database_ssl_enabled}"
DATABASE_SSL_CLIENT_CERT_ENABLED: "${db_database_ssl_client_cert_enabled}"
DATABASE_SSL_SERVER_CERT_ENABLED: "${db_database_ssl_server_cert_enabled}"
REDIS_HOST: full-stack-template-redis
REDIS_PORT: 6379
BUCKET_BUCKET: bucket
BUCKET_REGION: milkyway
BUCKET_ENDPOINT: http://full-stack-template-storage:9000/
BUCKET_FORCE_PATH_STYLE: "true"
BUCKET_KEY_ID: minio
BUCKET_KEY_SECRET: ${taito_default_password}
full-stack-template-www:
container_name: full-stack-template-www
build:
context: ./www
dockerfile: ${dockerfile}
args:
USER_UID: ${taito_host_user_uid}
restart: unless-stopped
networks:
- default
ports:
# TODO: Temporary hack for https://github.com/gatsbyjs/gatsby/issues/3721
# WARNING: Do not ever remove the 127.0.0.1 as on some systems Docker host ports are exposed outside the Firewall!
- "127.0.0.1:7463:8080"
volumes:
- "./www:/develop:delegated"
- "/develop/node_modules"
- "/develop/site/node_modules" # FOR GATSBY ONLY
# FOR GATSBY ONLY:
# - "/develop/site/node_modules"
environment:
# Paths
BASE_PATH: /docs
REPLACE_BASE_PATH: /docs # For Dockerfile.build
ASSETS_PATH: /docs
REPLACE_ASSETS_PATH: /docs # For Dockerfile.build
ASSETS_DOMAIN: ""
REPLACE_ASSETS_DOMAIN: "" # For Dockerfile.build
COMMON_PUBLIC_PORT: 9999
full-stack-template-redis:
container_name: full-stack-template-redis
image: bitnami/redis:6.0
restart: unless-stopped
networks:
- default
ports:
- "6379"
secrets:
- REDIS_PASSWORD
environment:
REDIS_PASSWORD_FILE: "/run/secrets/REDIS_PASSWORD"
REDIS_AOF_ENABLED: "no"
# "EXTERNAL RESOURCES"
full-stack-template-database:
container_name: full-stack-template-database
image: postgres:15
restart: unless-stopped
networks:
- default
ports:
# WARNING: Do not ever remove the 127.0.0.1 as on some systems Docker host ports are exposed outside the Firewall!
- "127.0.0.1:6000:5432"
secrets:
- DATABASE_PASSWORD
environment:
POSTGRES_DB: ${db_database_name}
POSTGRES_USER: ${db_database_app_username}
POSTGRES_PASSWORD_FILE: /run/secrets/DATABASE_PASSWORD
MYSQL_ROOT_PASSWORD: ${taito_default_password}
full-stack-template-storage:
container_name: full-stack-template-storage
build:
context: ./storage
dockerfile: ${dockerfile}
args:
USER_UID: ${taito_host_user_uid}
restart: unless-stopped
command: server /develop --console-address ":8888"
networks:
- default
ports:
- "9000"
- "8888:8888"
environment:
MINIO_ROOT_USER: minio
MINIO_ROOT_PASSWORD: ${taito_default_password}
# Subpath not yet supported: https://github.com/minio/minio/issues/12727
# MINIO_BROWSER_REDIRECT_URL: http://localhost:9999/minio
# "TOOLS"
# full-stack-template-pgadmin:
# container_name: full-stack-template-pgadmin
# image: dpage/pgadmin4
# restart: unless-stopped
# ports:
# - "8081:80"
# environment:
# PGADMIN_DEFAULT_EMAIL: [email protected]
# PGADMIN_DEFAULT_PASSWORD: root
# full-stack-template-pgweb:
# container_name: full-stack-template-pgweb
# image: sosedoff/pgweb
# restart: unless-stopped
# ports:
# - "8081:8081"
# command: pgweb --bind=0.0.0.0 --listen=8080 --prefix pgweb --url postgres://${db_database_app_username}:${taito_default_password}@full-stack-template-database:${db_database_port}/${db_database_name}?sslmode=disable
secrets:
DATABASE_PASSWORD:
file: ./secrets/${taito_env}/${db_database_app_secret}
REDIS_PASSWORD:
file: ./secrets/${taito_env}/${taito_project}-${taito_env}-redis.password
SESSION_SECRET:
file: ./secrets/${taito_env}/${taito_project}-${taito_env}-session.secret
EXAMPLE_SECRET:
file: ./secrets/${taito_env}/${taito_project}-${taito_env}-example.secret
networks:
default: