-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
169 lines (162 loc) · 6.01 KB
/
docker-compose.dev.yml
File metadata and controls
169 lines (162 loc) · 6.01 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# ══════════════════════════════════════════════════════════════════════
# Geny — Docker Compose (Development / Full)
#
# 소스 코드가 바인드 마운트되어 로컬 편집이 컨테이너에 즉시 반영됩니다.
# TTS 로컬 엔진은 --profile tts-local 로 활성화할 수 있습니다.
#
# - Backend : uvicorn --reload (watchfiles 기반 hot reload)
# - Frontend: next dev (HMR / Fast Refresh)
#
# Usage:
# docker compose -f docker-compose.dev.yml up --build
# docker compose -f docker-compose.dev.yml --profile tts-local up --build
# docker compose -f docker-compose.dev.yml down
# docker compose -f docker-compose.dev.yml logs -f
#
# 경량 버전 (TTS 없음):
# docker compose -f docker-compose.dev-core.yml up --build
#
# TTS 설정:
# GPT-SoVITS API URL → 설정 UI에서 http://gpt-sovits:9880 입력
# ══════════════════════════════════════════════════════════════════════
services:
# ── PostgreSQL Database ───────────────────────────────────────────
postgres:
image: postgres:16-alpine
container_name: geny-postgres-dev
init: true
restart: unless-stopped
ports:
- "127.0.0.1:${POSTGRES_PORT:-5432}:5432"
environment:
POSTGRES_DB: ${POSTGRES_DB:-geny}
POSTGRES_USER: ${POSTGRES_USER:-geny}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-geny123}
POSTGRES_INITDB_ARGS: "--encoding=UTF-8 --lc-collate=C --lc-ctype=C"
TZ: ${TIMEZONE:-Asia/Seoul}
volumes:
- geny-pgdata-dev:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-geny} -d ${POSTGRES_DB:-geny}"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
networks:
- geny-net-dev
# ── Backend (FastAPI + LangGraph + Claude CLI) — Dev Mode ─────────
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: geny-backend-dev
init: true
restart: unless-stopped
ports:
- "127.0.0.1:${BACKEND_PORT:-8000}:8000"
env_file:
- path: ./backend/.env
required: false
environment:
- APP_HOST=0.0.0.0
- APP_PORT=8000
- DEBUG_MODE=true
- GENY_AGENT_STORAGE_ROOT=/data/geny_agent_sessions
# PostgreSQL
- POSTGRES_HOST=postgres
- POSTGRES_PORT=5432
- POSTGRES_DB=${POSTGRES_DB:-geny}
- POSTGRES_USER=${POSTGRES_USER:-geny}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-geny123}
- AUTO_MIGRATION=true
- TIMEZONE=${TIMEZONE:-Asia/Seoul}
volumes:
# ── Bind mount: 로컬 소스 ↔ 컨테이너 동기화 ──────────────────
- ./backend:/app
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost:8000/health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 30s
networks:
- geny-net-dev
# ── Frontend (Next.js) — Dev Mode ─────────────────────────────────
frontend:
build:
context: ./frontend
dockerfile: Dockerfile.dev
container_name: geny-frontend-dev
init: true
restart: unless-stopped
ports:
- "127.0.0.1:${FRONTEND_PORT:-3000}:3000"
environment:
- API_URL=http://backend:8000
- NEXT_PUBLIC_BACKEND_PORT=${BACKEND_PORT:-8000}
- NEXT_PUBLIC_GPT_SOVITS_WEBUI_PORT=${GPT_SOVITS_WEBUI_PORT:-9874}
- PORT=3000
- HOSTNAME=0.0.0.0
volumes:
# ── Bind mount: 로컬 소스 ↔ 컨테이너 동기화 ──────────────────
- ./frontend/src:/app/src
- ./frontend/public:/app/public
- ./frontend/next.config.ts:/app/next.config.ts
- ./frontend/tsconfig.json:/app/tsconfig.json
- ./frontend/postcss.config.mjs:/app/postcss.config.mjs
depends_on:
backend:
condition: service_healthy
networks:
- geny-net-dev
# ── GPT-SoVITS (Optional — TTS 로컬 엔진, GPU 필요) ──────────────
# xxxxrt666/gpt-sovits:latest (공식 이미지, v2 API, 한국어 지원)
# api_v2.py → 포트 9880 서빙, webui.py → 포트 9874 (TTS Studio)
gpt-sovits:
image: xxxxrt666/gpt-sovits:latest-cu126
container_name: geny-gpt-sovits-dev
profiles: ["tts-local"]
init: true
restart: unless-stopped
working_dir: /workspace/GPT-SoVITS
command:
- /bin/bash
- "-c"
- |
pip install nvidia-npp-cu12 -q 2>/dev/null;
rm -rf GPT_SoVITS/pretrained_models GPT_SoVITS/text/G2PWModel tools/asr/models tools/uvr5/uvr5_weights 2>/dev/null;
ln -sf /workspace/models/pretrained_models GPT_SoVITS/pretrained_models;
ln -sf /workspace/models/G2PWModel GPT_SoVITS/text/G2PWModel;
ln -sf /workspace/models/asr_models tools/asr/models;
ln -sf /workspace/models/uvr5_weights tools/uvr5/uvr5_weights;
python webui.py &
exec python api_v2.py -a 0.0.0.0 -p 9880
ports:
- "127.0.0.1:${GPT_SOVITS_PORT:-9880}:9880"
- "127.0.0.1:${GPT_SOVITS_WEBUI_PORT:-9874}:9874"
volumes:
- ./backend/static/voices:/workspace/GPT-SoVITS/references:ro
tty: true
stdin_open: true
shm_size: 16G
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
environment:
- is_half=True
- LD_LIBRARY_PATH=/root/conda/lib:/root/conda/lib/python3.12/site-packages/nvidia/npp/lib
networks:
- geny-net-dev
networks:
geny-net-dev:
driver: bridge
volumes:
geny-pgdata-dev:
driver: local