-
Notifications
You must be signed in to change notification settings - Fork 281
/
docker-compose.yaml
236 lines (228 loc) · 6.32 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
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
version: "3.8"
services:
cognita-db:
image: postgres:13
container_name: cognita-postgres
restart: unless-stopped
ports:
- "${POSTGRES_PORT}:5432"
volumes:
- ./volumes/pgdata:/var/lib/postgresql/data
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: cognita-config
healthcheck:
test:
[
"CMD-SHELL",
"sh -c 'pg_isready -U ${POSTGRES_USER} -d cognita-config'",
]
interval: 30s
timeout: 60s
retries: 5
start_period: 15s
networks:
- cognita-docker
ollama-server:
image: ollama/ollama:0.1.42
pull_policy: if_not_present
restart: unless-stopped
container_name: ollama
profiles:
- ollama
volumes:
- ./volumes/ollama:/root/.ollama
ports:
- 11434:11434
healthcheck:
test: ["CMD", "ollama", "list"]
interval: 30s
timeout: 5s
retries: 3
start_period: 60s
environment:
- OLLAMA_KEEP_ALIVE=24h
- OLLAMA_HOST=0.0.0.0
- OLLAMA_PORT=11434
entrypoint: /bin/bash
command: -c "set -e; ollama serve & sleep 10 && ollama pull ${OLLAMA_MODEL} && sleep infinity"
networks:
- cognita-docker
infinity-server:
image: michaelf34/infinity:0.0.63
pull_policy: if_not_present
restart: unless-stopped
container_name: infinity
profiles:
- infinity
ports:
- "7997:7997"
volumes:
- ./volumes/infinity:/app/.cache
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:7997/health"]
interval: 30s
timeout: 5s
retries: 10
start_period: 30s
environment:
- INFINITY_MODEL_ID=${INFINITY_EMBEDDING_MODEL};${INFINITY_RERANKING_MODEL}
- INFINITY_BATCH_SIZE=8
- INFINITY_API_KEY=${INFINITY_API_KEY}
command: v2
networks:
- cognita-docker
qdrant-server:
image: qdrant/qdrant:v1.8.4
pull_policy: if_not_present
restart: unless-stopped
container_name: qdrant
ports:
- 6333:6333
- 6334:6334
expose:
- 6333
- 6334
- 6335
healthcheck:
test: ["CMD-SHELL", "/bin/bash -c ':> /dev/tcp/0.0.0.0/6333'"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
volumes:
- ./volumes/qdrant_storage:/qdrant/storage:z
networks:
- cognita-docker
unstructured-io-parsers:
# Docs: http://localhost:9500/general/docs
image: downloads.unstructured.io/unstructured-io/unstructured-api:0.0.73
pull_policy: if_not_present
restart: unless-stopped
container_name: unstructured-api
ports:
- 9500:9500
expose:
- 9500
environment:
- PORT=9500
healthcheck:
test:
[
"CMD",
"wget",
"-O",
"/dev/null",
"-o",
"/dev/null",
"http://localhost:9500/healthcheck",
]
interval: 30s
timeout: 5s
retries: 3
start_period: 5s
networks:
- cognita-docker
# https://github.com/fedirz/faster-whisper-server/tree/master
faster-whisper:
image: fedirz/faster-whisper-server:latest-cpu
pull_policy: if_not_present
container_name: faster-whisper
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
environment:
- WHISPER__MODEL=${WHISPER_MODEL}
- WHISPER__INFERENCE_DEVICE=auto
ports:
- ${WHISPER_PORT}:8000
volumes:
- ./volumes/hugging_face_cache:/root/.cache/huggingface
networks:
- cognita-docker
cognita-backend:
build:
context: .
dockerfile: ./backend/Dockerfile
restart: unless-stopped
container_name: cognita-backend
ports:
- "${COGNITA_BACKEND_PORT}:8000"
depends_on:
cognita-db:
condition: service_healthy
restart: true
qdrant-server:
condition: service_healthy
restart: true
unstructured-io-parsers:
condition: service_healthy
restart: true
volumes:
- .:/app
- ./volumes/pgdata:/var/lib/postgresql/data
- ./volumes/user_data:/app/user_data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health-check"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
environment:
- DEBUG_MODE=true
- LOCAL=${LOCAL}
- PROCESS_POOL_WORKERS=${PROCESS_POOL_WORKERS}
- LOG_LEVEL=DEBUG
- ML_REPO_NAME=${ML_REPO_NAME}
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@cognita-db:5432/cognita-config
- METADATA_STORE_CONFIG=${METADATA_STORE_CONFIG}
- VECTOR_DB_CONFIG=${VECTOR_DB_CONFIG}
- LOCAL_DATA_DIRECTORY=/app/user_data
- UNSTRUCTURED_IO_URL=${UNSTRUCTURED_IO_URL}
- UNSTRUCTURED_IO_API_KEY=${UNSTRUCTURED_IO_API_KEY}
- INFINITY_API_KEY=${INFINITY_API_KEY}
- MODELS_CONFIG_PATH=${MODELS_CONFIG_PATH}
- TFY_HOST=${TFY_HOST}
- TFY_API_KEY=${TFY_API_KEY}
- OPENAI_API_KEY=${OPENAI_API_KEY}
- BRAVE_API_KEY=${BRAVE_API_KEY}
entrypoint: /bin/bash
security_opt:
- seccomp:./seccomp.json
command: -c "set -e; prisma db push --schema ./backend/database/schema.prisma && uvicorn --host 0.0.0.0 --port 8000 backend.server.app:app --reload"
networks:
- cognita-docker
cognita-frontend:
build:
context: ./frontend
dockerfile: ./Dockerfile.dev
args:
- VITE_QA_FOUNDRY_URL=${VITE_QA_FOUNDRY_URL}
- VITE_DOCS_QA_DELETE_COLLECTIONS=${VITE_DOCS_QA_DELETE_COLLECTIONS}
- VITE_DOCS_QA_STANDALONE_PATH=${VITE_DOCS_QA_STANDALONE_PATH}
- VITE_DOCS_QA_ENABLE_REDIRECT=${VITE_DOCS_QA_ENABLE_REDIRECT}
- VITE_DOCS_QA_MAX_UPLOAD_SIZE_MB=${VITE_DOCS_QA_MAX_UPLOAD_SIZE_MB}
- VITE_USE_LOCAL=${LOCAL}
restart: unless-stopped
container_name: cognita-frontend
ports:
- "${COGNITA_FRONTEND_PORT}:5001"
volumes:
- ./frontend:/app
- /app/node_modules
depends_on:
cognita-backend:
condition: service_healthy
restart: true
entrypoint: /bin/bash
command: -c "set -e; yarn install --frozen-lockfile && yarn dev --host 0.0.0.0"
networks:
- cognita-docker
networks:
cognita-docker:
external: false