-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
87 lines (82 loc) · 2.4 KB
/
Copy pathdocker-compose.yml
File metadata and controls
87 lines (82 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
84
85
86
services:
# AI 서비스 (Python FastAPI + Gemini)
flowplan-ai:
build:
context: ./FlowPlanAI
dockerfile: Dockerfile
container_name: flowplan-ai
ports:
- "8000:8000" # 외부 접근 필요 시 활성화 (개발용)
environment:
- GEMINI_API_KEY=${GEMINI_API_KEY}
- APP_NAME=FlowPlanAI
- APP_VERSION=1.0.0
- API_V1_PREFIX=/api/v1
networks:
- flowplan-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
restart: unless-stopped
# 스프링 서버 (인증/인가 및 메인 로직)
flowplan-server:
build:
context: ./FlowPlanServer
dockerfile: Dockerfile
container_name: flowplan-server
ports:
- "8080:8080"
environment:
- AI_SERVICE_BASE_URL=http://flowplan-ai:8000
- SPRING_DATASOURCE_URL=jdbc:mysql://db:3306/${MYSQL_DATABASE}?useSSL=false&serverTimezone=Asia/Seoul&characterEncoding=UTF-&allowPublicKeyRetrieval=true
- SPRING_DATASOURCE_USERNAME=${MYSQL_USER}
- SPRING_DATASOURCE_PASSWORD=${MYSQL_PASSWORD}
- JWT_SECRET=${JWT_SECRET}
depends_on:
db:
condition: service_healthy
flowplan-ai:
condition: service_healthy
networks:
- flowplan-network
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/actuator/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 90s
restart: unless-stopped
# MySQL 데이터베이스
db:
image: mysql:8.0
container_name: flowplan-db
environment:
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- TZ=Asia/Seoul
volumes:
- mysql-data:/var/lib/mysql
ports:
- "3306:3306" # 개발용 외부 접근
networks:
- flowplan-network
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u${MYSQL_USER}", "-p${MYSQL_PASSWORD}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
restart: unless-stopped
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
networks:
flowplan-network:
driver: bridge
name: flowplan-network
volumes:
mysql-data:
driver: local