-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.app.yml
More file actions
83 lines (77 loc) · 2.4 KB
/
Copy pathdocker-compose.app.yml
File metadata and controls
83 lines (77 loc) · 2.4 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
version: '3.8'
services:
# 1. Eureka Server: 서비스 등록 및 상태 관리
eureka:
image: ${DOCKER_HUB_ID}/mango-eureka:latest
container_name: ${EUREKA_SERVER_NAME:-eureka}
env_file: .env
ports:
- "${EUREKA_PORT:-8761}:${EUREKA_PORT:-8761}" # 호스트 Nginx가 대시보드 접근 시 사용
healthcheck:
# 유레카 대시보드 API가 응답을 주는지 확인하여 '준비됨' 상태 판단
test: ["CMD-SHELL", "wget --quiet --tries=1 --spider http://localhost:${EUREKA_PORT:-8761}/eureka/apps || exit 1"]
interval: 10s
timeout: 5s
retries: 10 # 💡 재시도 횟수를 늘려 여유를 줌
start_period: 60s
networks:
- mango-network
restart: always
# 2. API Gateway: 외부 요청의 단일 진입점
gateway:
image: ${DOCKER_HUB_ID}/mango-gateway:latest
container_name: ${GATEWAY_SERVER_NAME:-gateway}
env_file: .env
ports:
- "${GATEWAY_PORT:-8080}:${GATEWAY_PORT:-8080}" # 호스트 Nginx가 API 요청 전달
depends_on:
eureka:
condition: service_started
networks:
- mango-network
restart: always
# 3. Core Service: 주요 비즈니스 로직
core:
image: ${DOCKER_HUB_ID}/mango-core:latest
container_name: core
env_file: .env
expose:
- "${CORE_PORT:-8081}" # 호스트에 노출하지 않고 도커 내부망에서만 사용
depends_on:
eureka:
condition: service_started
networks:
- mango-network
restart: always
# 4. Auction Service: 이중화(Scale) 대상
auction:
image: ${DOCKER_HUB_ID}/mango-auction:latest
# container_name을 지정하면 scale 기능을 쓸 수 없으므로 제거 (도커가 자동 생성)
env_file: .env
expose:
- "${AUCTION_PORT:-8082}"
deploy:
replicas: 2
depends_on:
eureka:
condition: service_started
networks:
- mango-network
restart: always
# 5. Media Service: 주요 비즈니스 로직
media:
image: ${DOCKER_HUB_ID}/mango-media:latest
container_name: media
env_file: .env
expose:
- "${MEDIA_PORT:-8083}" # 호스트에 노출하지 않고 도커 내부망에서만 사용
depends_on:
eureka:
condition: service_started
networks:
- mango-network
restart: always
networks:
# docker network create mango-network 로 미리 생성 필요
mango-network:
external: true