forked from Danessely/rutube-qa-rag
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
123 lines (97 loc) · 2.69 KB
/
docker-compose.yml
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
version: '2.3'
services:
search_engine:
restart: always
container_name: search_engine
mem_limit: 2600m
build:
context: ./search_engine
dockerfile: Dockerfile
image: search_engine:latest
environment:
DB_NAME: ${DB_NAME}
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
DB_HOST: ${DB_HOST}
DB_PORT: ${DB_PORT}
EMBEDDER_URL: ${EMBEDDER_URL}
NEURAL_URL: ${NEURAL_URL}
volumes:
- ./search_engine:/search_engine
command: bash -c "uvicorn src.main:app --host 0.0.0.0 --port ${SEARCH_ENGINE_PORT}"
ports:
- ${SEARCH_ENGINE_PORT}:${SEARCH_ENGINE_PORT}
- 27370:${SEARCH_ENGINE_PORT}
depends_on:
- postgres
- search_embedder
- neural_worker
search_embedder:
restart: always
container_name: search_embedder
mem_limit: 4G
build:
context: ./embedder
dockerfile: Dockerfile
image: search_embedder:latest
command: bash -c "uvicorn main:app --host 0.0.0.0 --port ${EMBEDDER_PORT}"
environment:
- NVIDIA_VISIBLE_DEVICES=${NVIDIA_VISIBLE_DEVICES_EMB}
- TRANSFORMERS_CACHE=${TRANSFORMERS_CACHE_EMB}
volumes:
- ./embedder:/embedder
# TEST ONLY
- /home/shace_linux/.cache/huggingface/hub:/cache/
runtime: nvidia
ports:
- ${EMBEDDER_PORT}:${EMBEDDER_PORT}
neural_worker:
restart: always
container_name: neural_worker
mem_limit: 32G
build:
context: ./neural_worker
dockerfile: Dockerfile
image: neural_worker:latest
command: bash -c "uvicorn main:app --host 0.0.0.0 --port ${WORKER_PORT}"
environment:
- NVIDIA_VISIBLE_DEVICES=${NVIDIA_VISIBLE_DEVICES_LLM}
- TRANSFORMERS_CACHE=${TRANSFORMERS_CACHE_LLM}
- HF_TOKEN=${HF_TOKEN}
volumes:
- ./neural_worker:/neural_worker
# TEST ONLY
- /home/shace_linux/.cache/huggingface/hub:/cache/
runtime: nvidia
ports:
- ${WORKER_PORT}:${WORKER_PORT}
postgres:
restart: always
container_name: postgres
mem_limit: 100m
image: postgres:13.3
environment:
POSTGRES_DB: ${DB_NAME}
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
PGDATA: "/var/lib/postgresql/data/pgdata"
volumes:
- ./pgdata:/var/lib/postgresql/data/pgdata
command: "-p ${DB_PORT}"
ports:
- ${DB_PORT}:${DB_PORT}
streamlit:
container_name: streamlit
build:
context: ./streamlit
dockerfile: Dockerfile
environment:
SE_HOST: ${SE_HOST}
SE_PORT: ${SE_PORT}
volumes:
- ./streamlit:/streamlit
command: ['streamlit', 'run', 'page.py']
ports:
- 27369:8501
depends_on:
- search_engine