-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
101 lines (95 loc) · 3.1 KB
/
Copy pathdocker-compose.yml
File metadata and controls
101 lines (95 loc) · 3.1 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
services:
# ============================================
# MySQL for Application Services
# ============================================
mysql:
image: mysql:8.0
container_name: saga-mysql
environment:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_USER: saga
MYSQL_PASSWORD: saga123
ports:
- "3306:3306"
volumes:
- mysql-data:/var/lib/mysql
- ./init-db.sql:/docker-entrypoint-initdb.d/init-db.sql
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
healthcheck:
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-prootpassword" ]
interval: 10s
timeout: 5s
retries: 5
# ============================================
# PostgreSQL for Temporal
# ============================================
temporal-postgres:
image: postgres:15-alpine
container_name: temporal-postgres
environment:
POSTGRES_USER: temporal
POSTGRES_PASSWORD: temporal
POSTGRES_DB: temporal
ports:
- "5432:5432"
volumes:
- temporal-postgres-data:/var/lib/postgresql/data
# ============================================
# Temporal Server
# ============================================
temporal:
image: temporalio/auto-setup:1.24.2
container_name: temporal
depends_on:
- temporal-postgres
environment:
- DB=postgres12
- DB_PORT=5432
- POSTGRES_USER=temporal
- POSTGRES_PWD=temporal
- POSTGRES_SEEDS=temporal-postgres
ports:
- "7233:7233"
# ============================================
# Temporal Web UI
# ============================================
temporal-ui:
image: temporalio/ui:2.26.2
container_name: temporal-ui
depends_on:
- temporal
environment:
- TEMPORAL_ADDRESS=temporal:7233
- TEMPORAL_CORS_ORIGINS=http://localhost:3000
ports:
- "8088:8080"
# ============================================
# Discovery Server (Service Registry)
# ============================================
# ./gradlew :discovery-server:bootRun
# 또는 Docker로 실행 시:
# discovery-server:
# build:
# context: ./discovery-server
# container_name: discovery-server
# ports:
# - "8761:8761"
# ============================================
# 서비스 실행 순서 (로컬)
# ============================================
# 1. docker-compose up -d (MySQL + Temporal 인프라)
# 2. ./gradlew :discovery-server:bootRun (포트: 8761)
# 3. ./gradlew :api-gateway:bootRun (포트: 8000) - API Gateway
# 4. ./gradlew :inventory-service:bootRun (포트: 8083)
# 5. ./gradlew :payment-service:bootRun (포트: 8081)
# 6. ./gradlew :order-service:bootRun (포트: 8080)
# 7. ./gradlew :saga-orchestrator:bootRun (포트: 8082)
#
# API Gateway를 통한 접근:
# - http://localhost:8000/api/orders/** → order-service
# - http://localhost:8000/api/inventory/** → inventory-service
# - http://localhost:8000/api/payments/** → payment-service
# - http://localhost:8000/api/saga/** → saga-orchestrator
volumes:
temporal-postgres-data:
mysql-data: