-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
263 lines (256 loc) · 8.52 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
version: "3.7"
services:
caddy:
container_name: caddy
image: lucaslorentz/caddy-docker-proxy:ci-alpine
ports:
- 80:80
- 443:443
environment:
- CADDY_INGRESS_NETWORKS=caddy
networks:
- caddy
volumes:
- /var/run/docker.sock:/var/run/docker.sock
restart: unless-stopped
labels:
caddy.log: ""
caddy.log.output: stdout
caddy.log.format: json
caddy.log.include: http.log.access.localhost
swagger:
image: swaggerapi/swagger-ui
env_file:
- ./.env
container_name: swagger
environment:
- URLS=
[
{url:'/api-docs/json', name:'spring'},
{url:'/api-docs-json', name:'nestjs'},
]
- BASE_URL=/docs
- SPRING_NAME=${SPRING_NAME}
- NESTJS_NAME=${NESTJS_NAME}
depends_on:
- ${SPRING_NAME}
- ${NESTJS_NAME}
networks:
- caddy
labels:
caddy.route: /docs*
caddy.route.reverse_proxy: "{{ upstreams 8080 }}"
nestjs-green:
image: makerscrew/server:latest
container_name: nestjs-green
ports:
- 3001:3000
restart: unless-stopped
env_file:
- ./.env
environment:
- TZ=Asia/Seoul
- DB_HOST=${DB_HOST}
- DB_PORT=${DB_PORT}
- DB_USERNAME=${DB_USERNAME}
- DB_PASSWORD=${DB_PASSWORD}
- DB_NAME=${DB_NAME}
- DB_SCHEMA=${DB_SCHEMA}
- AWS_S3_BUCKET_NAME=${AWS_S3_BUCKET_NAME}
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
- AWS_REGION=${AWS_REGION}
- JWT_SECRET=${JWT_SECRET}
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "10"
networks:
- caddy
labels:
caddy.log: "localhost"
# for Swagger spec
caddy.route_0: /api-docs-json
caddy.route_0.reverse_proxy: "{{ upstreams 3000 }}"
# for health check
caddy.route_1: /
caddy.route_1.reverse_proxy: "{{ upstreams 3000 }}"
caddy.route_2: /auth
caddy.route_2.reverse_proxy: "{{ upstreams 3000 }}"
caddy.route_3: /comment/v1
caddy.route_3.reverse_proxy: "{{ upstreams 3000 }}"
caddy.route_4: /comment/v1/*
caddy.route_4.reverse_proxy: "{{ upstreams 3000 }}"
caddy.route_5: /meeting/apply
caddy.route_5.reverse_proxy: "{{ upstreams 3000 }}"
caddy.route_6: /meeting
caddy.route_6.reverse_proxy: "{{ upstreams 3000 }}"
caddy.route_7: /meeting/v1/*
caddy.route_7.reverse_proxy: "{{ upstreams 3000 }}"
caddy.route_8: /meeting/*
caddy.route_8.reverse_proxy: "{{ upstreams 3000 }}"
caddy.route_9: /notice/v1
caddy.route_9.reverse_proxy: "{{ upstreams 3000 }}"
caddy.route_10: /notice/v1/*
caddy.route_10.reverse_proxy: "{{ upstreams 3000 }}"
caddy.route_11: /post/v1
caddy.route_11.reverse_proxy: "{{ upstreams 3000 }}"
caddy.route_12: /post/v1/*
caddy.route_12.reverse_proxy: "{{ upstreams 3000 }}"
caddy.route_13: /users
caddy.route_13.reverse_proxy: "{{ upstreams 3000 }}"
caddy.route_14: /users/*
caddy.route_14.reverse_proxy: "{{ upstreams 3000 }}"
spring-green:
image: makerscrew/main:latest
environment:
- TZ=Asia/Seoul
container_name: spring-green
ports:
- 4001:4000
restart: unless-stopped
depends_on:
- nestjs-green
networks:
- caddy
labels:
caddy.log: "localhost"
# for Swagger spec
caddy.route_0: /api-docs/json
caddy.route_0.reverse_proxy: "{{ upstreams 4000 }}"
# for health check
caddy.route_1: /health/*
caddy.route_1.reverse_proxy: "{{ upstreams 4000 }}"
caddy.route_2: /user/v2
caddy.route_2.reverse_proxy: "{{ upstreams 4000 }}"
caddy.route_3: /user/v2/*
caddy.route_3.reverse_proxy: "{{ upstreams 4000 }}"
caddy.route_4: /meeting/v2
caddy.route_4.reverse_proxy: "{{ upstreams 4000 }}"
caddy.route_5: /meeting/v2/*
caddy.route_5.reverse_proxy: "{{ upstreams 4000 }}"
caddy.route_6: /post/v2
caddy.route_6.reverse_proxy: "{{ upstreams 4000 }}"
caddy.route_7: /post/v2/*
caddy.route_7.reverse_proxy: "{{ upstreams 4000 }}"
caddy.route_8: /comment/v2
caddy.route_8.reverse_proxy: "{{ upstreams 4000 }}"
caddy.route_9: /comment/v2/*
caddy.route_9.reverse_proxy: "{{ upstreams 4000 }}"
caddy.route_10: /notice/v2
caddy.route_10.reverse_proxy: "{{ upstreams 4000 }}"
caddy.route_11: /advertisement/v2
caddy.route_11.reverse_proxy: "{{ upstreams 4000 }}"
caddy.route_12: /advertisement/v2/*
caddy.route_12.reverse_proxy: "{{ upstreams 4000 }}"
caddy.route_13: /auth/v2
caddy.route_13.reverse_proxy: "{{ upstreams 4000 }}"
caddy.route_14: /auth/v2/*
caddy.route_14.reverse_proxy: "{{ upstreams 4000 }}"
nestjs-blue:
image: makerscrew/server:latest
env_file:
- ./.env
environment:
- TZ=Asia/Seoul
- DB_HOST=${DB_HOST}
- DB_PORT=${DB_PORT}
- DB_USERNAME=${DB_USERNAME}
- DB_PASSWORD=${DB_PASSWORD}
- DB_NAME=${DB_NAME}
- DB_SCHEMA=${DB_SCHEMA}
- AWS_S3_BUCKET_NAME=${AWS_S3_BUCKET_NAME}
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
- AWS_REGION=${AWS_REGION}
- JWT_SECRET=${JWT_SECRET}
container_name: nestjs-blue
ports:
- 3002:3000
restart: unless-stopped
networks:
- caddy
labels:
caddy.log: "localhost"
# for Swagger spec
caddy.route_0: /api-docs-json
caddy.route_0.reverse_proxy: "{{ upstreams 3000 }}"
# for health check
caddy.route_1: /
caddy.route_1.reverse_proxy: "{{ upstreams 3000 }}"
caddy.route_2: /auth
caddy.route_2.reverse_proxy: "{{ upstreams 3000 }}"
caddy.route_3: /comment/v1
caddy.route_3.reverse_proxy: "{{ upstreams 3000 }}"
caddy.route_4: /comment/v1/*
caddy.route_4.reverse_proxy: "{{ upstreams 3000 }}"
caddy.route_5: /meeting/apply
caddy.route_5.reverse_proxy: "{{ upstreams 3000 }}"
caddy.route_6: /meeting
caddy.route_6.reverse_proxy: "{{ upstreams 3000 }}"
caddy.route_7: /meeting/v1/*
caddy.route_7.reverse_proxy: "{{ upstreams 3000 }}"
caddy.route_8: /meeting/*
caddy.route_8.reverse_proxy: "{{ upstreams 3000 }}"
caddy.route_9: /notice/v1
caddy.route_9.reverse_proxy: "{{ upstreams 3000 }}"
caddy.route_10: /notice/v1/*
caddy.route_10.reverse_proxy: "{{ upstreams 3000 }}"
caddy.route_11: /post/v1
caddy.route_11.reverse_proxy: "{{ upstreams 3000 }}"
caddy.route_12: /post/v1/*
caddy.route_12.reverse_proxy: "{{ upstreams 3000 }}"
caddy.route_13: /users
caddy.route_13.reverse_proxy: "{{ upstreams 3000 }}"
caddy.route_14: /users/*
caddy.route_14.reverse_proxy: "{{ upstreams 3000 }}"
spring-blue:
image: makerscrew/main:latest
environment:
- TZ=Asia/Seoul
container_name: spring-blue
ports:
- 4002:4000
restart: unless-stopped
depends_on:
- nestjs-blue
networks:
- caddy
labels:
caddy.log: "localhost"
# for Swagger spec
caddy.route_0: /api-docs/json
caddy.route_0.reverse_proxy: "{{ upstreams 4000 }}"
# for health check
caddy.route_1: /health/*
caddy.route_1.reverse_proxy: "{{ upstreams 4000 }}"
caddy.route_2: /user/v2
caddy.route_2.reverse_proxy: "{{ upstreams 4000 }}"
caddy.route_3: /user/v2/*
caddy.route_3.reverse_proxy: "{{ upstreams 4000 }}"
caddy.route_4: /meeting/v2
caddy.route_4.reverse_proxy: "{{ upstreams 4000 }}"
caddy.route_5: /meeting/v2/*
caddy.route_5.reverse_proxy: "{{ upstreams 4000 }}"
caddy.route_6: /post/v2
caddy.route_6.reverse_proxy: "{{ upstreams 4000 }}"
caddy.route_7: /post/v2/*
caddy.route_7.reverse_proxy: "{{ upstreams 4000 }}"
caddy.route_8: /comment/v2
caddy.route_8.reverse_proxy: "{{ upstreams 4000 }}"
caddy.route_9: /comment/v2/*
caddy.route_9.reverse_proxy: "{{ upstreams 4000 }}"
caddy.route_10: /notice/v2
caddy.route_10.reverse_proxy: "{{ upstreams 4000 }}"
caddy.route_11: /advertisement/v2
caddy.route_11.reverse_proxy: "{{ upstreams 4000 }}"
caddy.route_12: /advertisement/v2/*
caddy.route_12.reverse_proxy: "{{ upstreams 4000 }}"
caddy.route_13: /auth/v2
caddy.route_13.reverse_proxy: "{{ upstreams 4000 }}"
caddy.route_14: /auth/v2/*
caddy.route_14.reverse_proxy: "{{ upstreams 4000 }}"
networks:
caddy:
external: true