Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
83 lines (79 loc) · 1.93 KB
/
Copy pathdocker-compose.yml
File metadata and controls
83 lines (79 loc) · 1.93 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
services:
# Spring Boot 애플리케이션 서버 1
app1:
build: .
container_name: seat-lock-app1
ports:
- "8081:8080" # 호스트:컨테이너
environment:
- SPRING_PROFILES_ACTIVE=docker
- SERVER_NAME=app1
- SERVER_PORT=8080
extra_hosts:
- "host.docker.internal:host-gateway" # 로컬 MySQL 접근
networks:
- seat-lock-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/api/v1/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Spring Boot 애플리케이션 서버 2
app2:
build: .
container_name: seat-lock-app2
ports:
- "8082:8080"
environment:
- SPRING_PROFILES_ACTIVE=docker
- SERVER_NAME=app2
- SERVER_PORT=8080
extra_hosts:
- "host.docker.internal:host-gateway"
networks:
- seat-lock-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/api/v1/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Spring Boot 애플리케이션 서버 3
app3:
build: .
container_name: seat-lock-app3
ports:
- "8083:8080"
environment:
- SPRING_PROFILES_ACTIVE=docker
- SERVER_NAME=app3
- SERVER_PORT=8080
extra_hosts:
- "host.docker.internal:host-gateway"
networks:
- seat-lock-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/api/v1/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Nginx 로드 밸런서
nginx:
image: nginx:alpine
container_name: seat-lock-nginx
ports:
- "80:80" # HTTP
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro # nginx 설정 마운트
depends_on:
- app1
- app2
- app3
networks:
- seat-lock-network
restart: unless-stopped
networks:
seat-lock-network:
driver: bridge