forked from moduwa-aac/moduwa-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
119 lines (112 loc) · 2.99 KB
/
docker-compose.yml
File metadata and controls
119 lines (112 loc) · 2.99 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
services:
# ==========================================
# MySQL Database
# ==========================================
mysql:
image: mysql:8.0
container_name: moduwa_mysql
restart: always
init: true
environment:
MYSQL_ROOT_PASSWORD: root_password
MYSQL_DATABASE: moduwa_aac
MYSQL_USER: moduwa_user
MYSQL_PASSWORD: moduwa_password
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
networks:
- moduwa_network
command: --default-authentication-plugin=mysql_native_password --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
timeout: 20s
retries: 10
# ==========================================
# Redis (토큰 블랙리스트, 캐싱)
# ==========================================
redis:
image: redis:7-alpine
container_name: moduwa_redis
restart: always
ports:
- "6379:6379"
volumes:
- redis_data:/data
networks:
- moduwa_network
command: redis-server --appendonly yes
healthcheck:
test: ["CMD", "redis-cli", "ping"]
timeout: 3s
retries: 5
# ==========================================
# FastAPI AI Server (Python)
# ==========================================
fastapi:
image: ${FASTAPI_IMAGE:-fastapi-local}
build:
context: ./fastapi-server
dockerfile: Dockerfile
container_name: moduwa_fastapi
restart: always
environment:
OPENAI_API_KEY: ${OPENAI_API_KEY}
CORS_ORIGINS: http://localhost:3000
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_DB: 0
ports:
- "8000:8000"
volumes:
- ./fastapi-server:/app
networks:
- moduwa_network
command: uvicorn main:app --host 0.0.0.0 --port 8000
# ==========================================
# Backend API (Node.js + Express + Prisma)
# ==========================================
backend:
image: ${BACKEND_IMAGE:-backend-local}
build:
context: .
dockerfile: Dockerfile
container_name: moduwa_backend
restart: always
dns:
- 8.8.8.8
- 8.8.4.4
env_file:
- .env
environment:
DATABASE_URL: mysql://moduwa_user:moduwa_password@mysql:3306/moduwa_aac
REDIS_URL: redis://redis:6379
KAKAO_CLIENT_ID: ${KAKAO_CLIENT_ID}
KAKAO_REDIRECT_URI: ${KAKAO_REDIRECT_URI}
FASTAPI_URL: http://fastapi:8000
NODE_ENV: ${NODE_ENV:-development}
PORT: ${PORT:-3000}
APP_DEEP_LINK: ${APP_DEEP_LINK:-myapp}
ports:
- "3000:3000"
volumes:
- ./src:/app/src
- ./prisma:/app/prisma
- /app/node_modules
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
fastapi:
condition: service_started
networks:
- moduwa_network
command: npm run dev
volumes:
mysql_data:
redis_data:
networks:
moduwa_network:
driver: bridge