-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdocker-compose.yaml
78 lines (73 loc) · 2.01 KB
/
docker-compose.yaml
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
services:
db:
build:
context: ./db
environment:
# src: https://stackoverflow.com/a/26599273/14751074
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
volumes:
- db_vol:/var/lib/postgresql/data
restart: unless-stopped
client:
build:
context: ./client
environment:
- BACKEND_URL=server:${SERVER_PORT}
ports:
- ${CLIENT_PORT}:80
restart: unless-stopped
server:
build:
context: ./server
environment:
- LLM_SERVER=llm:${LLM_PORT}
- TTS_SERVER=tts:${TTS_PORT}
- DB_SERVER=db:${DB_PORT}
- JWT_SECRET_KEY=${JWT_SECRET_KEY}
- DB_USERNAME=${DB_USERNAME}
- DB_PASSWORD=${DB_PASSWORD}
- SERVER_PORT=${SERVER_PORT}
restart: unless-stopped
tts:
build:
context: ./tts
volumes:
- tts_vol:/root/.local/share/tts
environment:
- TTS_PORT=${TTS_PORT}
# skip xtts v2's license agreement
# see https://github.com/idiap/coqui-ai-TTS/issues/145#issuecomment-2466309889
- COQUI_TOS_AGREED=1
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
restart: unless-stopped
# equivalent of `docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama`
# https://stackoverflow.com/questions/78500319/how-to-pull-model-automatically-with-container-creation
# https://github.com/valiantlynx/ollama-docker/blob/main/docker-compose-ollama-gpu.yaml
llm:
build:
context: ./llm
volumes:
- llm_vol:/root/.ollama
environment:
- MODEL_NAME=${MODEL_NAME}
- LLM_PORT=${LLM_PORT}
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all # removing this thew everything back to CPU...
capabilities: [gpu]
restart: unless-stopped
volumes:
db_vol:
llm_vol:
tts_vol: