-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
281 lines (270 loc) · 7.72 KB
/
Copy pathdocker-compose.yml
File metadata and controls
281 lines (270 loc) · 7.72 KB
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
services:
buildkit:
image: moby/buildkit:latest
command:
[
"--addr",
"tcp://0.0.0.0:1234",
"--root",
"/var/lib/buildkit",
]
privileged: true
volumes:
- buildkit-data:/var/lib/buildkit
networks:
dequel:
aliases:
- buildkit
healthcheck:
test:
[
"CMD",
"wget",
"--spider",
"-q",
"tcp://localhost:1234",
]
interval: 5s
timeout: 3s
retries: 5
start_period: 5s
api:
image: ghcr.io/lftobs/dequel/api:latest
# build:
# context: ./apps/api
environment:
PORT: 3001
DATABASE_PATH: /app/data/dequel.db
WORKSPACE_ROOT: /app/workspace
CADDY_ROUTES_DIR: /caddy/routes
CADDY_BASE_DOMAIN: ${CADDY_BASE_DOMAIN:-localhost}
DOCKER_NETWORK: dequel_net
APP_INTERNAL_PORT: 3000
BUILDKIT_HOST: tcp://buildkit:1234
DOCKER_BIN: /usr/bin/docker
RAILPACK_VERBOSE: "1"
RAILPACK_BUILD_TIMEOUT_MS: "1200000"
volumes:
- ./data:/app/data
- ./workspace:/app/workspace
- ./infra/caddy/routes:/caddy/routes
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
buildkit:
condition: service_started
healthcheck:
test:
[
"CMD",
"curl",
"-fsS",
"http://localhost:3001/api/health",
]
interval: 50s
timeout: 3s
retries: 100
start_period: 10s
networks:
dequel:
aliases:
- api
web:
image: ghcr.io/lftobs/dequel/web:latest
# build:
# context: ./apps/web
healthcheck:
test:
[
"CMD",
"bun",
"-e",
"fetch('http://localhost:3000/').then(r=>{if(!r.ok)process.exit(1)}).catch(()=>process.exit(1))",
]
interval: 5s
timeout: 3s
retries: 10
start_period: 30s
networks:
dequel:
aliases:
- web
caddy:
image: caddy:2.8-alpine
command:
[
"caddy",
"run",
"--config",
"/etc/caddy/Caddyfile",
"--adapter",
"caddyfile",
"--watch",
]
environment:
CADDY_EMAIL: ${CADDY_EMAIL:-}
CADDY_BASE_DOMAIN: ${CADDY_BASE_DOMAIN:-localhost}
ports:
- "80:80"
- "443:443"
volumes:
- ./infra/caddy/Caddyfile:/etc/caddy/Caddyfile:ro
- ./infra/caddy/routes:/etc/caddy/routes
depends_on:
api:
condition: service_healthy
web:
condition: service_healthy
networks:
dequel:
redis:
image: redis:7-alpine
command: redis-server --appendonly yes
volumes:
- redis-data:/data
networks:
dequel:
aliases:
- redis
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
cadvisor:
image: gcr.io/cadvisor/cadvisor:latest
volumes:
- /:/rootfs:ro
- /var/run:/var/run:ro
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
- /dev/disk/:/dev/disk:ro
privileged: true
devices:
- /dev/kmsg
networks:
dequel:
aliases:
- cadvisor
healthcheck:
test:
[
"CMD",
"wget",
"--spider",
"-q",
"http://localhost:8080/metrics",
]
interval: 10s
timeout: 3s
retries: 3
start_period: 5s
prometheus:
image: prom/prometheus:latest
command:
- --config.file=/etc/prometheus/prometheus.yml
- --storage.tsdb.path=/prometheus
- --web.console.libraries=/usr/share/prometheus/console_libraries
- --web.console.templates=/usr/share/prometheus/consoles
- --storage.tsdb.retention.time=30d
volumes:
- ./infra/monitoring/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus-data:/prometheus
depends_on:
cadvisor:
condition: service_started
networks:
dequel:
aliases:
- prometheus
healthcheck:
test:
[
"CMD",
"wget",
"--spider",
"-q",
"http://localhost:9090/-/ready",
]
interval: 10s
timeout: 3s
retries: 3
start_period: 5s
loki:
image: grafana/loki:3.0.0
command:
- -config.file=/etc/loki/loki-config.yml
volumes:
- ./infra/monitoring/loki-config.yml:/etc/loki/loki-config.yml:ro
- loki-data:/loki
networks:
dequel:
aliases:
- loki
healthcheck:
test:
[
"CMD",
"wget",
"--spider",
"-q",
"http://localhost:3100/ready",
]
interval: 10s
timeout: 3s
retries: 3
start_period: 10s
promtail:
image: grafana/promtail:3.0.0
command:
- -config.file=/etc/promtail/promtail-config.yml
volumes:
- ./infra/monitoring/promtail-config.yml:/etc/promtail/promtail-config.yml:ro
- /var/run/docker.sock:/var/run/docker.sock
- /var/lib/docker/containers:/var/lib/docker/containers:ro
depends_on:
loki:
condition: service_started
networks:
dequel:
grafana:
image: grafana/grafana:latest
environment:
GF_SECURITY_ADMIN_USER: admin
GF_SECURITY_ADMIN_PASSWORD: admin
GF_SERVER_ROOT_URL: http://localhost/grafana
GF_SERVER_SERVE_FROM_SUB_PATH: "true"
GF_INSTALL_PLUGINS: ""
volumes:
- ./infra/monitoring/grafana/datasources:/etc/grafana/provisioning/datasources:ro
- grafana-data:/var/lib/grafana
depends_on:
prometheus:
condition: service_started
loki:
condition: service_started
networks:
dequel:
aliases:
- grafana
healthcheck:
test:
[
"CMD",
"wget",
"--spider",
"-q",
"http://localhost:3000/api/health",
]
interval: 10s
timeout: 3s
retries: 5
start_period: 15s
networks:
dequel:
name: dequel_net
volumes:
buildkit-data:
redis-data:
prometheus-data:
loki-data:
grafana-data: