-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
164 lines (154 loc) · 5.5 KB
/
Copy pathdocker-compose.yml
File metadata and controls
164 lines (154 loc) · 5.5 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
services:
staging-codevideo-api:
build:
context: ./codevideo-api
dockerfile: Dockerfile
image: staging-codevideo-api
container_name: staging-codevideo-api
ports:
- "6999:6999"
restart: always
networks:
- codevideo-network
volumes:
- ./tmp/v3/:/usr/src/app/tmp/v3/
env_file: .env.staging
# TTS_SERVICE_URL points at the self-hosted codevideo-tts service. To use it,
# set CODEVIDEO_TTS_PROVIDER=kokoro in .env.staging (default stays elevenlabs).
environment:
- TTS_SERVICE_URL=http://codevideo-tts:3000
depends_on:
- codevideo-tts
codevideo-api:
build:
context: ./codevideo-api
dockerfile: Dockerfile
image: codevideo-api
container_name: codevideo-api
# exposed on the docker network only (nginx proxies to codevideo-api:7000),
# not published to the host. The render worker is now the codevideo-cli
# container (below); its :7000/:7001 are container-internal, so there's no
# host-port contention to design around. The local override publishes :7000
# for dev.
expose:
- "7000"
restart: always
networks:
- codevideo-network
volumes:
- ./tmp/v3/:/usr/src/app/tmp/v3/
env_file: .env
# set CODEVIDEO_TTS_PROVIDER=kokoro in .env to switch this instance to the
# self-hosted TTS service below (default stays elevenlabs until you flip it).
environment:
- TTS_SERVICE_URL=http://codevideo-tts:3000
depends_on:
- codevideo-tts
# The old gatsby-static-server (host :7001) was removed: the render worker (the
# codevideo-cli container, below) bundles its own static server on :7001 serving
# the embedded IDE, so this container was redundant. Now that the worker is
# containerized its :7001 is container-internal anyway. Render-only (no nginx
# route); re-add only if a public path ever needs it.
languagetool:
image: erikvl87/languagetool
container_name: languagetool
ports:
- "8010:8010"
restart: always
networks:
- codevideo-network
# Self-hosted, vendor-free TTS (Kokoro, pure Node) — ./codevideo-tts.
# Reached by the API at http://codevideo-tts:3000 on the internal network.
codevideo-tts:
build:
context: ./codevideo-tts
dockerfile: Dockerfile
image: codevideo-tts
container_name: codevideo-tts
restart: always
networks:
- codevideo-network
volumes:
# persist the ~300MB Kokoro model across restarts
- codevideo-tts-models:/app/.hf-cache
# shared secrets (TTS_API_KEY bearer, KOKORO_* defaults) come from the central
# .env. PORT is pinned to 3000 here because the service reads a bare
# process.env.PORT and the shared .env carries the API's PORT — environment:
# overrides env_file:, so this keeps TTS on 3000.
env_file: .env
environment:
- PORT=3000
- HF_HOME=/app/.hf-cache
# Render worker — the codevideo-cli Go binary in serve mode, pulled from Docker
# Hub (built from the separate codevideo/codevideo-cli repo, not a local build
# context). It watches the shared tmp/v3 render queue, records each manifest with
# headless Chrome, then uploads the mp4 to S3, emails the user (Clerk), posts to
# Slack, and decrements tokens. Coupled to the API only through the tmp/v3 bind
# mount — they never call each other. One worker drains both prod and staging
# (both API services write into the same tmp/v3/new).
codevideo-cli:
image: fullstackcraft/codevideo-cli:0.0.8 # pinned; bump per codevideo-cli release
container_name: codevideo-cli
restart: always
init: true # reap orphaned Chromium children (the leak noted in DEPLOYMENT.md)
shm_size: "1gb" # headless Chrome needs more than the 64MB default /dev/shm
networks:
- codevideo-network
volumes:
- ./tmp/v3/:/work/tmp/v3/ # same host dir the API mounts — the shared render queue
env_file: .env # S3, Clerk, Slack, Mailjet, TTS creds from the central env
environment:
- CODEVIDEO_WORK_DIR=/work/tmp/v3
- TTS_SERVICE_URL=http://codevideo-tts:3000 # kokoro path, mirrors the API
depends_on:
- codevideo-tts
# Genie generation backend (LLM -> streamed CodeVideo actions), ./codevideo-genie;
# nginx proxies /genie here. One port (3001) serves both the HTTP trigger and the
# WebSocket stream. Reads the central .env (LLM_PROVIDER + GEMINI_API_KEY or
# ANTHROPIC_API_KEY, plus CLERK_SECRET_KEY).
codevideo-genie:
build:
context: ./codevideo-genie
dockerfile: Dockerfile
image: codevideo-genie
container_name: codevideo-genie
restart: always
networks:
- codevideo-network
expose:
- "3001"
env_file: .env
environment:
- NODE_ENV=production
- GENIE_HTTP_PORT=3001
- GENIE_TRUST_PROXY=1
nginx:
build:
context: ./nginx
dockerfile: Dockerfile
image: nginx:latest
container_name: nginx
ports:
- "80:80"
- "443:443"
restart: always
networks:
- codevideo-network
depends_on:
- codevideo-api
- codevideo-genie
volumes:
- ./nginx/conf/:/etc/nginx/conf.d/:ro
- ./certbot/www/:/var/www/certbot/:ro
- ./certbot/conf/live/:/etc/nginx/ssl/live:ro
- ./certbot/conf/archive/:/etc/nginx/ssl/archive:ro
certbot:
image: certbot/certbot:latest
volumes:
- ./certbot/www/:/var/www/certbot/:rw
- ./certbot/conf/:/etc/letsencrypt/:rw
networks:
codevideo-network:
driver: bridge
volumes:
codevideo-tts-models: