-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
79 lines (77 loc) · 2.58 KB
/
docker-compose.prod.yml
File metadata and controls
79 lines (77 loc) · 2.58 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
# ========================================
# Finders API - Production Override (Blue-Green)
# ========================================
# Override 파일: docker-compose.infra.yml (base)과 함께 사용
#
# 사용법:
# # Blue 슬롯 실행:
# docker compose -f docker-compose.infra.yml -f docker-compose.prod.yml --profile blue up -d
#
# # Green 슬롯 실행:
# docker compose -f docker-compose.infra.yml -f docker-compose.prod.yml --profile green up -d
#
# # 슬롯 전환 (blue → green):
# docker compose -f docker-compose.infra.yml -f docker-compose.prod.yml --profile green up -d
# docker compose -f docker-compose.infra.yml -f docker-compose.prod.yml --profile blue down
# ========================================
services:
# ── Production Blue Slot ──
prod-blue:
image: ${DOCKER_IMAGE:-findersofficial/finders-api}:latest
restart: unless-stopped
env_file:
- .env.prod
environment:
SPRING_PROFILES_ACTIVE: prod
SPRING_DATA_REDIS_SSL_ENABLED: "true"
TZ: Asia/Seoul
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:8080/api/actuator/health"]
interval: 20s
timeout: 5s
retries: 5
start_period: 60s
logging:
driver: "gcplogs"
options:
labels: "app=finders-api,env=prod,slot=blue"
labels:
- "traefik.enable=true"
- "traefik.http.routers.prod.rule=Host(`api.finders.it.kr`)"
- "traefik.http.routers.prod.entrypoints=web"
- "traefik.http.services.prod.loadbalancer.server.port=8080"
- "traefik.http.services.prod.loadbalancer.server.scheme=http"
profiles:
- blue
networks:
- finders-network
# ── Production Green Slot ──
prod-green:
image: ${DOCKER_IMAGE:-findersofficial/finders-api}:latest
restart: unless-stopped
env_file:
- .env.prod
environment:
SPRING_PROFILES_ACTIVE: prod
SPRING_DATA_REDIS_SSL_ENABLED: "true"
TZ: Asia/Seoul
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:8080/api/actuator/health"]
interval: 20s
timeout: 5s
retries: 5
start_period: 60s
logging:
driver: "gcplogs"
options:
labels: "app=finders-api,env=prod,slot=green"
labels:
- "traefik.enable=true"
- "traefik.http.routers.prod.rule=Host(`api.finders.it.kr`)"
- "traefik.http.routers.prod.entrypoints=web"
- "traefik.http.services.prod.loadbalancer.server.port=8080"
- "traefik.http.services.prod.loadbalancer.server.scheme=http"
profiles:
- green
networks:
- finders-network