-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod-core.yml
More file actions
158 lines (151 loc) · 5.52 KB
/
docker-compose.prod-core.yml
File metadata and controls
158 lines (151 loc) · 5.52 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
# ══════════════════════════════════════════════════════════════════════
# Geny — Docker Compose (Production with Nginx / Core — 경량 버전)
#
# TTS 로컬 엔진 없이 핵심 서비스만 실행합니다.
# 도메인을 연결하여 단일 포트(80)로 backend / frontend를 라우팅합니다.
#
# /api/* → backend:8000
# /health → backend:8000
# /static/assets/* → backend:8000
# /* → frontend:3000
#
# Usage:
# docker compose -f docker-compose.prod-core.yml up --build -d
# docker compose -f docker-compose.prod-core.yml down
# docker compose -f docker-compose.prod-core.yml logs -f
#
# 전체 버전 (TTS 포함):
# docker compose -f docker-compose.prod.yml up --build -d
#
# 도메인 / SSL 설정:
# DOMAIN=geny.example.com → nginx server_name 에 반영
# SSL 은 별도의 certbot 또는 Cloudflare 등으로 처리 후
# nginx/nginx.conf 에 443 블록을 추가하세요.
#
# Port 변경:
# NGINX_PORT=58443 docker compose -f docker-compose.prod-core.yml up --build
# ══════════════════════════════════════════════════════════════════════
services:
# ── PostgreSQL Database ───────────────────────────────────────────
postgres:
image: postgres:16-alpine
container_name: geny-postgres-prod
restart: unless-stopped
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-prod:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-geny} -d ${POSTGRES_DB:-geny}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
networks:
- geny-net-prod
# ── Backend (FastAPI + LangGraph + Claude CLI) ────────────────────
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: geny-backend-prod
restart: unless-stopped
expose:
- "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}
# MemoryProvider (Phase 2) — unset / "disabled" keeps registry dormant.
- MEMORY_PROVIDER=${MEMORY_PROVIDER:-}
- MEMORY_DSN=${MEMORY_DSN:-}
- MEMORY_DIALECT=${MEMORY_DIALECT:-}
- MEMORY_ROOT=${MEMORY_ROOT:-}
- MEMORY_SCOPE=${MEMORY_SCOPE:-session}
- MEMORY_TIMEZONE=${MEMORY_TIMEZONE:-}
- MEMORY_PROVIDER_ATTACH=${MEMORY_PROVIDER_ATTACH:-false}
- MEMORY_API_PROVIDER=${MEMORY_API_PROVIDER:-false}
- MEMORY_LEGACY_STM=${MEMORY_LEGACY_STM:-true}
- MEMORY_LEGACY_LTM=${MEMORY_LEGACY_LTM:-true}
- MEMORY_LEGACY_NOTES=${MEMORY_LEGACY_NOTES:-true}
- MEMORY_LEGACY_VECTOR=${MEMORY_LEGACY_VECTOR:-true}
- MEMORY_LEGACY_CURATED=${MEMORY_LEGACY_CURATED:-true}
# EnvironmentService (Phase 3)
- ENVIRONMENT_STORAGE_PATH=${ENVIRONMENT_STORAGE_PATH:-./data/environments}
volumes:
- geny-tts-cache-prod:/app/cache/tts
- geny-voices-prod:/app/static/voices
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
networks:
- geny-net-prod
# ── Frontend (Next.js) ────────────────────────────────────────────
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
- API_URL=http://backend:8000
- NEXT_PUBLIC_API_URL=
container_name: geny-frontend-prod
restart: unless-stopped
expose:
- "3000"
environment:
- API_URL=http://backend:8000
- NEXT_PUBLIC_API_URL=
- PORT=3000
- HOSTNAME=0.0.0.0
depends_on:
backend:
condition: service_healthy
networks:
- geny-net-prod
# ── Nginx Reverse Proxy ───────────────────────────────────────────
nginx:
image: nginx:1.27-alpine
container_name: geny-nginx-prod
restart: unless-stopped
ports:
- "${NGINX_PORT:-58443}:80"
volumes:
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
frontend:
condition: service_started
backend:
condition: service_healthy
networks:
- geny-net-prod
networks:
geny-net-prod:
driver: bridge
volumes:
geny-pgdata-prod:
driver: local
geny-tts-cache-prod:
driver: local
geny-voices-prod:
driver: local