-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdocker-compose.yml
324 lines (317 loc) · 13.1 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
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
x-defaults:
&defaults
ENVIRONMENT: production
services:
landing:
image: ghcr.io/teknologi-umum/pesto-landing:edge
environment:
<<: [ *defaults ]
PORT: 3000
labels:
- "traefik.enable=true"
- "traefik.docker.network=pesto"
- "traefik.http.routers.landing.entrypoints=web,websecure"
- "traefik.http.routers.landing.rule=Host(`pesto.teknologiumum.com`)"
- "traefik.http.routers.landing.priority=1"
- "traefik.http.routers.landing.tls.certresolver=tlsresolver"
- "traefik.http.routers.landing.middlewares=landing-header,landing-rate,landing-redirectscheme"
- "traefik.http.services.landing.loadbalancer.server.port=3000"
- "traefik.http.services.landing.loadbalancer.server.scheme=http"
- "traefik.http.services.landing.loadbalancer.healthcheck.interval=30s"
- "traefik.http.services.landing.loadbalancer.healthcheck.path=/"
- "traefik.http.middlewares.landing-rate.ratelimit.average=100"
- "traefik.http.middlewares.landing-rate.ratelimit.burst=20"
- "traefik.http.middlewares.landing-rate.ratelimit.period=1s"
- "traefik.http.middlewares.landing-header.headers.accesscontrolallowmethods=GET,OPTIONS"
- "traefik.http.middlewares.landing-header.headers.accesscontrolalloworiginlist=https://teknologiumum.com"
- "traefik.http.middlewares.landing-header.headers.accesscontrolmaxage=604800"
- "traefik.http.middlewares.landing-header.headers.addvaryheader=true"
- "traefik.http.middlewares.landing-header.headers.frameDeny=true"
- "traefik.http.middlewares.landing-header.headers.browserxssfilter=true"
- "traefik.http.middlewares.landing-header.headers.stsSeconds=604800"
- "traefik.http.middlewares.landing-header.headers.stsIncludeSubdomains=true"
- "traefik.http.middlewares.landing-header.headers.browserXssFilter=true"
- "traefik.http.middlewares.landing-header.headers.contentTypeNosniff=true"
- "traefik.http.middlewares.landing-header.headers.customResponseHeaders.server=Teknologi Umum"
- "traefik.http.middlewares.landing-redirectscheme.redirectscheme.scheme=https"
- "traefik.http.middlewares.landing-redirectscheme.redirectscheme.permanent=true"
- "com.centurylinklabs.watchtower.enable=true"
platform: linux/amd64
storage_opt:
size: '1G'
logging:
driver: json-file
options:
max-size: 10m
max-file: 3
healthcheck:
test: "curl -f http://localhost:3000/ || exit 1"
interval: 15s
timeout: 10s
retries: 5
deploy:
mode: replicated
replicas: 1
restart_policy:
condition: unless-stopped
delay: 30s
window: 120s
resources:
limits:
memory: 350MB
cpus: '0.75'
reservations:
memory: 25MB
cpus: '0.10'
networks:
- pesto
db:
image: ghcr.io/teknologi-umum/pesto-redis:edge
platform: linux/amd64
healthcheck:
test: "redis-cli ping | grep PONG"
interval: 10s
timeout: 5s
retries: 5
deploy:
mode: replicated
replicas: 1
restart_policy:
condition: unless-stopped
delay: 30s
window: 60s
resources:
limits:
memory: 2GB
cpus: '1'
reservations:
memory: 100MB
cpus: '0.25'
networks:
- internal
volumes:
- redis-data
auth:
image: ghcr.io/teknologi-umum/pesto-auth:edge
environment:
<<: [ *defaults ]
PORT: 3000
SENTRY_DSN: ${AUTH_SENTRY_DSN}
REDIS_URL: redis://@db:6379/
labels:
- "traefik.enable=true"
- "traefik.docker.network=pesto"
- "traefik.http.routers.auth.entrypoints=web,websecure"
- "traefik.http.routers.auth.middlewares=auth-error,auth-header,auth-rate"
- "traefik.http.services.auth.loadbalancer.server.port=3000"
- "traefik.http.services.auth.loadbalancer.server.scheme=http"
- "traefik.http.services.auth.loadbalancer.healthcheck.interval=30s"
- "traefik.http.services.auth.loadbalancer.healthcheck.path=/healthz"
- "traefik.http.middlewares.auth-error.errors.status=500-599"
- "traefik.http.middlewares.auth-error.errors.service=landing@docker"
- "traefik.http.middlewares.auth-error.errors.query=/500"
- "traefik.http.middlewares.auth-rate.ratelimit.average=20"
- "traefik.http.middlewares.auth-rate.ratelimit.burst=5"
- "traefik.http.middlewares.auth-rate.ratelimit.period=1s"
- "traefik.http.middlewares.auth-header.headers.addvaryheader=true"
- "traefik.http.middlewares.auth-header.headers.frameDeny=true"
- "traefik.http.middlewares.auth-header.headers.browserxssfilter=true"
- "traefik.http.middlewares.auth-header.headers.stsSeconds=604800"
- "traefik.http.middlewares.auth-header.headers.stsIncludeSubdomains=true"
- "traefik.http.middlewares.auth-header.headers.browserXssFilter=true"
- "traefik.http.middlewares.auth-header.headers.contentTypeNosniff=true"
- "traefik.http.middlewares.auth-header.headers.customResponseHeaders.server=Teknologi Umum"
- "com.centurylinklabs.watchtower.enable=true"
platform: linux/amd64
storage_opt:
size: '1G'
logging:
driver: json-file
options:
max-size: 10m
max-file: 3
healthcheck:
test: "wget -q --spider http://localhost:3000/healthz || exit 1"
interval: 15s
timeout: 10s
retries: 5
deploy:
mode: replicated
replicas: 1
restart_policy:
condition: unless-stopped
delay: 30s
window: 120s
resources:
limits:
memory: 500MB
cpus: '0.75'
reservations:
memory: 10MB
cpus: '0.10'
depends_on:
db:
condition: service_healthy
networks:
- pesto
- internal
rce:
image: ghcr.io/teknologi-umum/pesto-rce:edge
environment:
<<: [ *defaults ]
PORT: 50051
SENTRY_DSN: ${RCE_SENTRY_DSN}
labels:
- "traefik.enable=true"
- "traefik.docker.network=pesto"
- "traefik.http.routers.rce.entrypoints=web,websecure"
- "traefik.http.routers.rce.rule=Host(`pesto.teknologiumum.com`) && PathPrefix(`/api`)"
- "traefik.http.routers.rce.priority=3"
- "traefik.http.routers.rce.tls.certresolver=tlsresolver"
- "traefik.http.routers.rce.middlewares=rce-auth,rce-error,rce-header,rce-rate,rce-redirectscheme"
- "traefik.http.services.rce.loadbalancer.server.port=50051"
- "traefik.http.services.rce.loadbalancer.server.scheme=http"
- "traefik.http.services.rce.loadbalancer.healthcheck.interval=30s"
- "traefik.http.services.rce.loadbalancer.healthcheck.path=/healthz"
- "traefik.http.middlewares.rce-auth.forwardauth.address=http://auth:3000/"
- "traefik.http.middlewares.rce-auth.forwardauth.authRequestHeaders=Accept,X-Pesto-Token,Referer,Origin"
- "traefik.http.middlewares.rce-auth.forwardauth.authResponseHeaders=Sentry-Trace,Baggage"
- "traefik.http.middlewares.rce-auth.forwardauth.tls.insecureSkipVerify=true"
- "traefik.http.middlewares.rce-error.errors.status=500-599"
- "traefik.http.middlewares.rce-error.errors.service=landing@docker"
- "traefik.http.middlewares.rce-error.errors.query=/500"
- "traefik.http.middlewares.rce-rate.ratelimit.average=500"
- "traefik.http.middlewares.rce-rate.ratelimit.burst=100"
- "traefik.http.middlewares.rce-rate.ratelimit.period=1m"
- "traefik.http.middlewares.rce-header.headers.accesscontrolallowmethods=GET,OPTIONS,POST"
- "traefik.http.middlewares.rce-header.headers.accesscontrolalloworiginlist=*"
- "traefik.http.middlewares.rce-header.headers.accesscontrolmaxage=604800"
- "traefik.http.middlewares.rce-header.headers.addvaryheader=true"
- "traefik.http.middlewares.rce-header.headers.frameDeny=true"
- "traefik.http.middlewares.rce-header.headers.browserxssfilter=true"
- "traefik.http.middlewares.rce-header.headers.stsSeconds=604800"
- "traefik.http.middlewares.rce-header.headers.stsIncludeSubdomains=true"
- "traefik.http.middlewares.rce-header.headers.browserXssFilter=true"
- "traefik.http.middlewares.rce-header.headers.contentTypeNosniff=true"
- "traefik.http.middlewares.rce-header.headers.customResponseHeaders.server=Teknologi Umum"
- "traefik.http.middlewares.rce-redirectscheme.redirectscheme.scheme=https"
- "traefik.http.middlewares.rce-redirectscheme.redirectscheme.permanent=true"
- "com.centurylinklabs.watchtower.enable=true"
platform: linux/amd64
storage_opt:
size: '5G'
logging:
driver: json-file
options:
max-size: 10m
max-file: 3
healthcheck:
test: "curl -f http://localhost:50051/healthz || exit 1"
interval: 15s
timeout: 5s
retries: 5
deploy:
mode: replicated
replicas: 2
restart_policy:
condition: unless-stopped
delay: 30s
window: 120s
resources:
limits:
memory: 4GB
cpus: '2'
reservations:
memory: 100MB
cpus: '0.10'
networks:
- pesto
- internal
registration:
image: ghcr.io/teknologi-umum/pesto-registration:edge
environment:
<<: [ *defaults ]
PORT: "3000"
SENTRY_DSN: ${REGISTRATION_SENTRY_DSN}
REDIS_URL: redis://@db:6379/
labels:
- "traefik.enable=true"
- "traefik.docker.network=pesto"
- "traefik.http.routers.registration.entrypoints=web,websecure"
- "traefik.http.routers.registration.rule=Host(`pesto.teknologiumum.com`) && Path(`/api/register`)"
- "traefik.http.routers.registration.priority=5"
- "traefik.http.routers.registration.tls.certresolver=tlsresolver"
- "traefik.http.routers.registration.middlewares=registration-error,registration-header,registration-rate,registration-redirectscheme,registration-inflightreq"
- "traefik.http.services.registration.loadbalancer.server.port=3000"
- "traefik.http.services.registration.loadbalancer.server.scheme=http"
- "traefik.http.services.registration.loadbalancer.healthcheck.interval=30s"
- "traefik.http.services.registration.loadbalancer.healthcheck.path=/healthz"
- "traefik.http.middlewares.registration-error.errors.status=500-599"
- "traefik.http.middlewares.registration-error.errors.service=landing@docker"
- "traefik.http.middlewares.registration-error.errors.query=/500"
- "traefik.http.middlewares.registration-rate.ratelimit.average=100"
- "traefik.http.middlewares.registration-rate.ratelimit.burst=10"
- "traefik.http.middlewares.registration-rate.ratelimit.period=1m"
- "traefik.http.middlewares.registration-header.headers.accesscontrolallowmethods=GET,OPTIONS,POST"
- "traefik.http.middlewares.registration-header.headers.accesscontrolalloworiginlist=*"
- "traefik.http.middlewares.registration-header.headers.accesscontrolmaxage=604800"
- "traefik.http.middlewares.registration-header.headers.addvaryheader=true"
- "traefik.http.middlewares.registration-header.headers.frameDeny=true"
- "traefik.http.middlewares.registration-header.headers.browserxssfilter=true"
- "traefik.http.middlewares.registration-header.headers.stsSeconds=604800"
- "traefik.http.middlewares.registration-header.headers.stsIncludeSubdomains=true"
- "traefik.http.middlewares.registration-header.headers.browserXssFilter=true"
- "traefik.http.middlewares.registration-header.headers.contentTypeNosniff=true"
- "traefik.http.middlewares.registration-header.headers.customResponseHeaders.server=Teknologi Umum"
- "traefik.http.middlewares.registration-redirectscheme.redirectscheme.scheme=https"
- "traefik.http.middlewares.registration-redirectscheme.redirectscheme.permanent=true"
- "traefik.http.middlewares.registration-inflightreq.inflightreq.amount=50"
- "com.centurylinklabs.watchtower.enable=true"
platform: linux/amd64
storage_opt:
size: '1G'
logging:
driver: json-file
options:
max-size: 10m
max-file: 3
healthcheck:
test: "wget -q --spider http://localhost:3000/healthz || exit 1"
interval: 15s
timeout: 10s
retries: 5
depends_on:
db:
condition: service_healthy
deploy:
mode: replicated
replicas: 1
restart_policy:
condition: unless-stopped
delay: 30s
window: 120s
resources:
limits:
memory: 500MB
cpus: '1'
reservations:
memory: 10MB
cpus: '0.10'
networks:
- pesto
- internal
networks:
pesto:
driver: bridge
external: true
ipam:
config:
- subnet: 10.32.50.0/27
internal:
driver: bridge
external: false
ipam:
config:
- subnet: 10.32.51.0/27
volumes:
redis-data: