-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
172 lines (163 loc) · 5.75 KB
/
docker-compose.yml
File metadata and controls
172 lines (163 loc) · 5.75 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
170
171
172
# ══════════════════════════════════════════════════════════════════════
# Geny — Docker Compose (Standalone / Full)
#
# 전체 서비스 포함 (TTS 로컬 엔진은 --profile tts-local 로 활성화)
#
# Usage:
# docker compose up --build # 기본 실행 (TTS 미포함)
# docker compose up -d # 백그라운드 실행
# docker compose --profile tts-local up # TTS 로컬 엔진 포함
# docker compose down # 종료
# docker compose logs -f # 로그 확인
#
# Port 변경:
# BACKEND_PORT=8080 FRONTEND_PORT=3001 docker compose up --build
#
# 또는 .env 파일로 설정:
# BACKEND_PORT=8080
# FRONTEND_PORT=3001
#
# TTS 설정:
# GPT-SoVITS API URL → 설정 UI에서 http://gpt-sovits:9880 입력
# ══════════════════════════════════════════════════════════════════════
services:
# ── PostgreSQL Database ───────────────────────────────────────────
postgres:
image: postgres:16-alpine
container_name: geny-postgres
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:/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
# ── Backend (FastAPI + LangGraph + Claude CLI) ────────────────────
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: geny-backend
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
- 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:
- geny-tts-cache:/app/cache/tts
- geny-voices:/app/static/voices
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost:8000/health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 15s
networks:
- geny-net
# ── Frontend (Next.js) ────────────────────────────────────────────
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
- API_URL=http://backend:8000
container_name: geny-frontend
init: true
restart: unless-stopped
ports:
- "127.0.0.1:${FRONTEND_PORT:-3000}:3000"
environment:
- API_URL=http://backend:8000
- PORT=3000
- HOSTNAME=0.0.0.0
depends_on:
backend:
condition: service_healthy
networks:
- geny-net
# ── GPT-SoVITS (Optional — TTS 로컬 엔진, GPU 필요) ──────────────
# xxxxrt666/gpt-sovits (공식 이미지, v2 API, 한국어 지원)
# api_v2.py → 포트 9880 서빙, webui.py → 포트 9874 (TTS Studio)
gpt-sovits:
image: xxxxrt666/gpt-sovits:latest-cu126
container_name: geny-gpt-sovits
profiles: ["tts-local"]
init: true
restart: unless-stopped
working_dir: /workspace/GPT-SoVITS
command:
- /bin/bash
- "-c"
- |
echo '[1/3] Installing nvidia-npp-cu12...';
pip install --no-cache-dir nvidia-npp-cu12;
echo '[2/3] Fixing torchaudio...';
pip install --no-cache-dir --no-deps --force-reinstall torchaudio==2.10.0 --index-url https://download.pytorch.org/whl/cu126;
echo '[3/3] Starting GPT-SoVITS...';
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:
- geny-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=False
- LD_LIBRARY_PATH=/root/conda/lib:/root/conda/lib/python3.12/site-packages/nvidia/npp/lib
networks:
- geny-net
networks:
geny-net:
driver: bridge
volumes:
geny-pgdata:
driver: local
geny-tts-cache:
driver: local
geny-voices:
driver: local