-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
74 lines (70 loc) · 2.34 KB
/
Copy pathdocker-compose.yml
File metadata and controls
74 lines (70 loc) · 2.34 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
# Local stack: Postgres+pgvector, the API, and an optional Qdrant.
#
# cp .env.example .env # add OPENAI_API_KEY
# docker compose up --build
# open http://localhost:8000/docs
#
# Verified from a clean clone — if this does not come up, that is a bug in this
# file, not in your machine.
services:
db:
image: pgvector/pgvector:pg16
environment:
POSTGRES_USER: documind
POSTGRES_PASSWORD: documind
POSTGRES_DB: documind
ports:
# Configurable because a locally-installed Postgres already owns 5432 on
# a lot of machines, and "port is already allocated" is an unhelpful first
# experience. Override with POSTGRES_PORT=5433 in .env.
- "${POSTGRES_PORT:-5432}:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
# The API must not start migrating against a database that is still
# initialising, which is exactly what happens without this gate.
test: ["CMD-SHELL", "pg_isready -U documind -d documind"]
interval: 5s
timeout: 5s
retries: 20
api:
build:
context: .
args:
INCLUDE_LOCAL_MODELS: "true"
depends_on:
db:
condition: service_healthy
environment:
ENVIRONMENT: docker
DATABASE_URL: postgresql+asyncpg://documind:documind@db:5432/documind
OPENAI_API_KEY: ${OPENAI_API_KEY:?set OPENAI_API_KEY in .env}
ACTIVE_CONFIG: ${ACTIVE_CONFIG:-D}
CORS_ORIGINS: ${CORS_ORIGINS:-http://localhost:3000}
LANGFUSE_PUBLIC_KEY: ${LANGFUSE_PUBLIC_KEY:-}
LANGFUSE_SECRET_KEY: ${LANGFUSE_SECRET_KEY:-}
LANGFUSE_HOST: ${LANGFUSE_HOST:-https://cloud.langfuse.com}
QDRANT_URL: ${QDRANT_URL:-}
ports:
- "8000:8000"
volumes:
# Source mount for iteration; the HF cache is a named volume so model
# weights survive a rebuild instead of being re-downloaded every time.
- .:/app
- hf_cache:/home/documind/.cache/huggingface
command: >
sh -c "alembic upgrade head &&
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload"
# Optional second vector store, for the pgvector/Qdrant comparison.
# docker compose --profile qdrant up
qdrant:
image: qdrant/qdrant:v1.12.4
profiles: ["qdrant"]
ports:
- "6333:6333"
volumes:
- qdrant_data:/qdrant/storage
volumes:
pgdata:
hf_cache:
qdrant_data: