-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yaml
323 lines (311 loc) · 9.38 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
323
name: 'elysia_auth'
services:
# Svelte App (Static Site)
svelte:
image: svelte
build:
context: ../svelte-page
ports:
- "8080:80"
deploy:
replicas: 1
labels:
- "traefik.enable=true"
- "traefik.http.routers.svelte.rule=Host(`hello.simmons.studio`)"
- "traefik.http.routers.svelte.entrypoints=web"
- "traefik.http.services.svelte.loadbalancer.server.port=80"
- 'traefik.http.routers.store.tls=true'
- 'traefik.http.routers.store.tls.certresolver=leresolver'
api:
build:
context: .
dockerfile: Dockerfile
labels:
- studio.simmons=simmonsstudiozm/elysia-auth:slim
privileged: true
depends_on:
- db
- cache
- store
- mailhog
environment:
- NODE_ENV=production
- MAINTENANCE_MODE=false
- PORT=3000
- HOST=api
- TZ=Africa/Harare
- JWT_SECRET=simplytestingelysiasjwtprod
- DO_TELEMETRY=false
- SMTP_PORT=1025
- RESEND_API_KEY=re_1234
- DATABASE_USER=postgres
- DATABASE_PASSWORD=postgres
- DATABASE_HOST=db
- DATABASE_PORT=5432
- DATABASE_NAME=authdb
- DATABASE_URL=postgresql://postgres:postgres@db:5432/authdb?schema=public
- MINIO_HOST=store
- MINIO_PORT=9000
- MINIO_ACCESS_KEY=SxQQJe31nq8ZbXoNukSf # KMFJCQNRB3OEUUN3QMAM
- MINIO_SECRET_KEY=OuVLLHdpUUFEsBoyQDUdYYmASYvhfbcDTypWG8EX # FR5OCNeQerRFfLwkfPvhdemHg4sJAndiowPZw1mZ
- BUCKET_USERS=hello-users
- BUCKET_PRODUCTS=hello-products
- BUCKET_PHOTOS=hello-photos
- BUCKET_FILES=hello-files
- IMAGE_QUALITY=78
- THUMBNAIL_QUALITY=48
- BLUR_AMOUNT=3
- REDIS_HOST=cache
- REDIS_PORT=6379
#command: "/bin/sh -c 'sleep 10 && bun prisma:seed'"
#command: "/bin/sh -c 'bunx prisma migrate deploy'"
volumes:
- api_migration_one:/usr/src/app/prisma/migrations/0_init
- logs_storage:/usr/src/app/logs
entrypoint: ["/usr/src/app/entrypoint.sh"] # ✅ entrypoint here
networks:
default:
aliases:
- api
ports: ["3000:3000"]
restart: unless-stopped
deploy:
replicas: 1
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.api.rule=Host(`api.hello.simmons.studio`)'
- 'traefik.http.services.api.loadbalancer.server.port=3000'
- 'traefik.http.routers.api.entrypoints=websecure'
- 'traefik.http.routers.api.tls=true'
- 'traefik.http.routers.api.tls.certresolver=leresolver'
db:
image: postgres:17.2-bullseye
restart: unless-stopped
ports:
- "5432:5432"
environment:
- POSTGRES_NAME=authdb
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
# healthcheck:
# test: ["CMD-SHELL", "pg_isready"]
# interval: 1m30s
# timeout: 30s
# retries: 5
# start_period: 30s
networks:
default:
aliases:
- db
volumes:
- pgdata:/var/lib/postgresql/data
- api_migration_one:/docker-entrypoint-initdb.d:ro # Mount SQL migrations directory as Read-only
store:
image: minio/minio:RELEASE.2025-01-20T14-49-07Z
restart: always
ports:
- "9000:9000"
- "9001:9001"
environment:
- MINIO_HOST=store
- MINIO_ROOT_USER=Rosetta
- MINIO_ROOT_PASSWORD=Rosetta2022
networks:
default:
aliases:
- store
command: server /data --console-address ":9001"
volumes:
#- /var/lib/docker/minio/data:/data
- minio_data:/data
deploy:
replicas: 1
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.store.rule=Host(`store.hello.simmons.studio`)'
- 'traefik.http.services.store.loadbalancer.server.port=9001'
- 'traefik.http.routers.store.entrypoints=websecure'
- 'traefik.http.routers.store.tls=true'
- 'traefik.http.routers.store.tls.certresolver=leresolver'
pgadmin:
image: dpage/pgadmin4:8.8
# container_name: pgadmin
restart: unless-stopped
depends_on:
- db
environment:
- PGADMIN_DEFAULT_PASSWORD=root
ports:
- "8080:80"
networks:
default:
aliases:
- pgadmin
volumes:
- pgadmin_data:/var/lib/pgadmin
deploy:
replicas: 1
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.pgadmin.rule=Host(`pgadmin.hello.simmons.studio`)'
- 'traefik.http.services.pgadmin.loadbalancer.server.port=8080'
- 'traefik.http.routers.pgadmin.entrypoints=websecure'
- 'traefik.http.routers.pgadmin.tls=true'
- 'traefik.http.routers.pgadmin.tls.certresolver=leresolver'
cache:
image: redis:7.4.0-alpine
restart: always
ports:
- "6379:6379"
volumes:
- cache_data:/data
#- /path/to/local/redis.conf:/usr/local/etc/redis/redis.conf
environment:
- ALLOW_EMPTY_PASSWORD=yes
- REDIS_PASSWORD=eYVX7EwVmmxKPCDmwMtyKVge8oLd2t81
- REDIS_DATABASES=3
networks:
default:
aliases:
- cache
command: redis-server --save 20 1 --loglevel warning
deploy:
replicas: 1
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.cache.rule=Host(`cache.hello.simmons.studio`)'
- 'traefik.http.services.cache.loadbalancer.server.port=6379'
- 'traefik.http.routers.cache.entrypoints=websecure'
- 'traefik.http.routers.cache.tls=true'
- 'traefik.http.routers.cache.tls.certresolver=leresolver'
redis_insight:
image: redis/redisinsight:2.66.0-arm64
container_name: redis_insight
restart: always
ports:
#- 8001:8001
- 5540:5540
volumes:
- redis_insight_volume_data:/data
networks:
default:
aliases:
- redis_insight
deploy:
replicas: 1
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.redis_insight.rule=Host(`insight.hello.simmons.studio`)'
- 'traefik.http.services.redis_insight.loadbalancer.server.port=5540'
- 'traefik.http.routers.redis_insight.entrypoints=websecure'
- 'traefik.http.routers.redis_insight.tls=true'
- 'traefik.http.routers.redis_insight.tls.certresolver=leresolver'
mailpit:
image: axllent/mailpit:v1.22.0
container_name: mailpit
restart: unless-stopped
ports:
- 1025:1025 # SMTP server port
- 8025:8025 # MailHog web UI port
environment:
TZ: Africa/Harare
MP_MAX_MESSAGES: 5000
MP_DATABASE: /data/mailpit.db
MP_SMTP_AUTH_ACCEPT_ANY: 1
MP_SMTP_AUTH_ALLOW_INSECURE: 1
networks:
default:
aliases:
- mailpit
volumes:
- mailpit_data:/data
deploy:
replicas: 1
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.mailpit.rule=Host(`mail.hello.simmons.studio`)'
- 'traefik.http.services.mailpit.loadbalancer.server.port=8025'
- 'traefik.http.routers.mailpit.entrypoints=websecure'
- 'traefik.http.routers.mailpit.tls=true'
- 'traefik.http.routers.mailpit.tls.certresolver=leresolver'
prometheus:
image: prom/prometheus
ports:
- "9090:9090"
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus-data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.retention.time=30d' # Retain data for 30 days
networks:
default:
aliases:
- prometheus
deploy:
replicas: 1
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.prometheus.rule=Host(`metrics.hello.simmons.studio`)'
- 'traefik.http.services.prometheus.loadbalancer.server.port=9090'
- 'traefik.http.routers.prometheus.entrypoints=websecure'
- 'traefik.http.routers.prometheus.tls=true'
- 'traefik.http.routers.prometheus.tls.certresolver=leresolver'
grafana:
image: grafana/grafana:11.4.0
ports:
- "3001:3000"
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
volumes:
- grafana-storage:/var/lib/grafana
networks:
default:
aliases:
- grafana
deploy:
replicas: 1
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.grafana.rule=Host(`grafana.hello.simmons.studio`)'
- 'traefik.http.services.grafana.loadbalancer.server.port=3000'
- 'traefik.http.routers.grafana.entrypoints=websecure'
- 'traefik.http.routers.grafana.tls=true'
- 'traefik.http.routers.grafana.tls.certresolver=leresolver'
loki:
image: grafana/loki
ports:
- "3100:3100"
volumes:
- ./loki-config.yaml:/etc/loki/local-config.yaml
networks:
default:
aliases:
- loki
deploy:
replicas: 1
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.loki.rule=Host(`logs.hello.simmons.studio`)'
- 'traefik.http.services.loki.loadbalancer.server.port=3100'
- 'traefik.http.routers.loki.entrypoints=websecure'
- 'traefik.http.routers.loki.tls=true'
- 'traefik.http.routers.loki.tls.certresolver=leresolver'
# networks:
# api_net:
# driver: bridge
# ipam:
# config:
# - subnet: 172.10.0.0/16
volumes:
api_migration_one:
logs_storage:
pgdata:
minio_data:
pgadmin_data:
cache_data:
redis_insight_volume_data:
mailpit_data:
prometheus-data:
grafana-storage: