-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
77 lines (73 loc) · 2.32 KB
/
Copy pathdocker-compose.yml
File metadata and controls
77 lines (73 loc) · 2.32 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
services:
postgres:
image: pgvector/pgvector:pg16
container_name: braindb_postgres
restart: unless-stopped
networks:
local-network:
aliases:
- braindb_postgres
environment:
POSTGRES_USER: ${POSTGRES_USER:-braindb}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-braindb}
POSTGRES_DB: ${POSTGRES_DB:-braindb}
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 12
api:
build: .
image: braindb:local
container_name: braindb_api
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
networks:
- local-network
environment:
DATABASE_URL: ${DATABASE_URL}
API_PORT: ${API_PORT:-8000}
HF_TOKEN: ${HF_TOKEN:-}
LLM_PROFILE: ${LLM_PROFILE:-deepinfra}
AGENT_MODEL: ${AGENT_MODEL:-}
AGENT_BASE_URL: ${AGENT_BASE_URL:-}
AGENT_API_KEY: ${AGENT_API_KEY:-}
OPENAI_API_KEY: ${OPENAI_API_KEY:-}
NVIDIA_NIM_API_KEY: ${NVIDIA_NIM_API_KEY:-}
DEEPINFRA_API_KEY: ${DEEPINFRA_API_KEY:-}
VLLM_API_KEY: ${VLLM_API_KEY:-}
AGENT_VERBOSE: ${AGENT_VERBOSE:-false}
extra_hosts:
# Lets self-hosted profiles (e.g. vllm_workstation) reach a server bound
# to the Docker host's loopback. Docker Desktop sets this implicitly;
# the explicit form keeps the file portable to Linux Docker Engine.
- "host.docker.internal:host-gateway"
ports:
- "${API_PORT:-8000}:${API_PORT:-8000}"
volumes:
- .:/app
command: >
sh -c "until python -c 'import os, psycopg2; conn = psycopg2.connect(os.environ[\"DATABASE_URL\"]); conn.close()'; do echo waiting for database; sleep 2; done; alembic upgrade head && uvicorn braindb.main:app --host 0.0.0.0 --port ${API_PORT:-8000} --reload"
watcher:
image: braindb:local
container_name: braindb_watcher
restart: unless-stopped
depends_on:
- api
networks:
- local-network
environment:
BRAINDB_API_URL: http://api:${API_PORT:-8000}
INGEST_POLL_INTERVAL: ${INGEST_POLL_INTERVAL:-7}
volumes:
- .:/app
command: python -m braindb.ingest_watcher
networks:
local-network:
external: true
volumes:
postgres-data: