-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yml
More file actions
255 lines (237 loc) · 7.07 KB
/
compose.yml
File metadata and controls
255 lines (237 loc) · 7.07 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
name: deck-dev
x-logging: &logging
driver: json-file
options:
max-size: "5m"
max-file: "2"
x-app-common: &app-common
logging: *logging
environment:
SPRING_PROFILES_ACTIVE: dev
DATABASE_URL: ${DATABASE_URL:?DATABASE_URL is required}
APP_BASE_URL: ${APP_BASE_URL}
APP_CRYPTO_CURRENT_PROVIDER: ${APP_CRYPTO_CURRENT_PROVIDER:-ENV}
APP_CRYPTO_PROVIDERS_ENV_KEK: ${APP_CRYPTO_PROVIDERS_ENV_KEK:?APP_CRYPTO_PROVIDERS_ENV_KEK is required}
APP_CRYPTO_PROVIDERS_ENV_KEK_KID: ${APP_CRYPTO_PROVIDERS_ENV_KEK_KID:-kek-v1}
GOOGLE_OAUTH_CLIENT_SECRET: ${GOOGLE_OAUTH_CLIENT_SECRET:-}
RESET_ADMIN_PASSWORD_FOR_DEV: ${RESET_ADMIN_PASSWORD_FOR_DEV:-}
depends_on:
db:
condition: service_healthy
healthcheck:
test:
- CMD-SHELL
- curl -fsS http://127.0.0.1:8011/actuator/health/readiness | jq -e '.status == "UP"' >/dev/null || exit 1
interval: 5s
timeout: 5s
retries: 24
start_period: 20s
stop_grace_period: 30s
restart: unless-stopped
services:
db:
logging: *logging
image: ${IMAGE_REGISTRY}/deck-postgres:${POSTGRES_IMAGE_TAG:-dev-latest}
environment:
POSTGRES_USER: deck
POSTGRES_PASSWORD: ${DB_PASSWORD:-deck}
POSTGRES_DB: deck
POSTGRES_INITDB_ARGS: "--locale=ko_KR.UTF-8"
ports:
- "${DB_PORT:-5432}:5432"
volumes:
- db-data:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U deck -d deck"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
app-1:
<<: *app-common
image: ${IMAGE_REGISTRY}/deck-app:${APP_IMAGE_TAG:-dev-latest}
profiles: [app]
expose:
- "8011"
volumes:
- app-logs:/app/logs
networks:
default:
ipv4_address: 10.200.0.11
app-2:
<<: *app-common
image: ${IMAGE_REGISTRY}/deck-app:${APP_IMAGE_TAG:-dev-latest}
profiles: [app]
expose:
- "8011"
volumes:
- app-logs:/app/logs
networks:
default:
ipv4_address: 10.200.0.12
nginx-app:
logging: *logging
image: nginx:1.27-alpine
profiles: [app]
ports:
- "80:80"
- "443:443"
command:
- sh
- -c
- |
[ -f /etc/nginx/upstreams/app/app-1.conf ] || printf 'server 127.0.0.1:1 down max_fails=3 fail_timeout=10s;\n' > /etc/nginx/upstreams/app/app-1.conf
[ -f /etc/nginx/upstreams/app/app-2.conf ] || printf 'server 127.0.0.1:1 down max_fails=3 fail_timeout=10s;\n' > /etc/nginx/upstreams/app/app-2.conf
exec nginx -g 'daemon off;'
volumes:
- ./nginx/app.conf:/etc/nginx/conf.d/default.conf:ro
- ./nginx/upstreams/app:/etc/nginx/upstreams/app
- /etc/letsencrypt:/etc/letsencrypt:ro
- /var/www/certbot:/var/www/certbot:ro
depends_on:
- app-1
- app-2
restart: unless-stopped
linkpie-1:
<<: *app-common
image: ${IMAGE_REGISTRY}/deck-linkpie:${LINKPIE_IMAGE_TAG:-dev-latest}
profiles: [linkpie]
expose:
- "8011"
volumes:
- linkpie-logs:/app/logs
networks:
default:
ipv4_address: 10.200.0.21
linkpie-2:
<<: *app-common
image: ${IMAGE_REGISTRY}/deck-linkpie:${LINKPIE_IMAGE_TAG:-dev-latest}
profiles: [linkpie]
expose:
- "8011"
volumes:
- linkpie-logs:/app/logs
networks:
default:
ipv4_address: 10.200.0.22
nginx-linkpie:
logging: *logging
image: nginx:1.27-alpine
profiles: [linkpie]
ports:
- "80:80"
- "443:443"
command:
- sh
- -c
- |
[ -f /etc/nginx/upstreams/linkpie/linkpie-1.conf ] || printf 'server 127.0.0.1:1 down max_fails=3 fail_timeout=10s;\n' > /etc/nginx/upstreams/linkpie/linkpie-1.conf
[ -f /etc/nginx/upstreams/linkpie/linkpie-2.conf ] || printf 'server 127.0.0.1:1 down max_fails=3 fail_timeout=10s;\n' > /etc/nginx/upstreams/linkpie/linkpie-2.conf
exec nginx -g 'daemon off;'
volumes:
- ./nginx/linkpie.conf:/etc/nginx/conf.d/default.conf:ro
- ./nginx/upstreams/linkpie:/etc/nginx/upstreams/linkpie
- /etc/letsencrypt:/etc/letsencrypt:ro
- /var/www/certbot:/var/www/certbot:ro
depends_on:
- linkpie-1
- linkpie-2
restart: unless-stopped
deskpie-1:
<<: *app-common
image: ${IMAGE_REGISTRY}/deck-deskpie:${DESKPIE_IMAGE_TAG:-dev-latest}
profiles: [deskpie]
expose:
- "8011"
volumes:
- deskpie-logs:/app/logs
networks:
default:
ipv4_address: 10.200.0.31
deskpie-2:
<<: *app-common
image: ${IMAGE_REGISTRY}/deck-deskpie:${DESKPIE_IMAGE_TAG:-dev-latest}
profiles: [deskpie]
expose:
- "8011"
volumes:
- deskpie-logs:/app/logs
networks:
default:
ipv4_address: 10.200.0.32
nginx-deskpie:
logging: *logging
image: nginx:1.27-alpine
profiles: [deskpie]
ports:
- "80:80"
- "443:443"
command:
- sh
- -c
- |
[ -f /etc/nginx/upstreams/deskpie/deskpie-1.conf ] || printf 'server 127.0.0.1:1 down max_fails=3 fail_timeout=10s;\n' > /etc/nginx/upstreams/deskpie/deskpie-1.conf
[ -f /etc/nginx/upstreams/deskpie/deskpie-2.conf ] || printf 'server 127.0.0.1:1 down max_fails=3 fail_timeout=10s;\n' > /etc/nginx/upstreams/deskpie/deskpie-2.conf
exec nginx -g 'daemon off;'
volumes:
- ./nginx/deskpie.conf:/etc/nginx/conf.d/default.conf:ro
- ./nginx/upstreams/deskpie:/etc/nginx/upstreams/deskpie
- /etc/letsencrypt:/etc/letsencrypt:ro
- /var/www/certbot:/var/www/certbot:ro
depends_on:
- deskpie-1
- deskpie-2
restart: unless-stopped
loki:
logging: *logging
image: grafana/loki:3.6.4
volumes:
- ../../../shared/monitoring/base/loki.yaml:/etc/loki/local-config.yaml
command: -config.file=/etc/loki/local-config.yaml
restart: unless-stopped
promtail:
logging: *logging
image: grafana/promtail:3.6.4
volumes:
- app-logs:/var/log/app:ro
- linkpie-logs:/var/log/linkpie:ro
- deskpie-logs:/var/log/deskpie:ro
- ../../../shared/monitoring/compose/promtail.yaml:/etc/promtail/config.yaml
command: -config.file=/etc/promtail/config.yaml
depends_on:
- loki
restart: unless-stopped
prometheus:
logging: *logging
image: prom/prometheus:v3.8.0
command: --config.file=/etc/prometheus/prometheus.yml --storage.tsdb.retention.time=3d
volumes:
- ../../../shared/monitoring/compose/prometheus.dev.yaml:/etc/prometheus/prometheus.yml
restart: unless-stopped
grafana:
logging: *logging
image: grafana/grafana:12.3.1
ports:
- "${GRAFANA_PORT:-3011}:3000"
environment:
GF_AUTH_ANONYMOUS_ENABLED: "false"
GF_AUTH_DISABLE_LOGIN_FORM: "false"
GF_SECURITY_ADMIN_USER: admin
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_ADMIN_PASSWORD:-deck}
volumes:
- ../../../shared/monitoring/base/grafana/provisioning:/etc/grafana/provisioning
depends_on:
- loki
- prometheus
restart: unless-stopped
networks:
default:
driver: bridge
ipam:
config:
- subnet: 10.200.0.0/24
volumes:
db-data:
app-logs:
linkpie-logs:
deskpie-logs: