Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
66 lines (62 loc) · 2.1 KB
/
Copy pathdocker-compose.yml
File metadata and controls
66 lines (62 loc) · 2.1 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
# Local development stack for the RAG Refinement System.
# Provides PostgreSQL (structure store, ADR-10) and Qdrant (vector store, ADR-2)
# alongside the API. ChromaDB is the documented dev alternative per ADR-2, but
# this compose targets Qdrant to mirror production. Secrets are injected at run
# time from the developer's local .env (see .env.example) and are never baked in.
services:
postgres:
image: postgres:16
environment:
POSTGRES_USER: ${POSTGRES_USER:-rag}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD must be set}
POSTGRES_DB: ${POSTGRES_DB:-rag}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-rag}"]
interval: 10s
timeout: 5s
retries: 5
qdrant:
image: qdrant/qdrant:v1.11.0
ports:
- "127.0.0.1:6333:6333"
- "127.0.0.1:6334:6334"
volumes:
- qdrant_data:/qdrant/storage
healthcheck:
test: ["CMD-SHELL", "bash -c ':> /dev/tcp/127.0.0.1/6333' || exit 1"]
interval: 10s
timeout: 5s
retries: 5
api:
build:
context: .
dockerfile: Dockerfile
ports:
- "8000:8000"
environment:
DATABASE_URL: postgresql://${POSTGRES_USER:-rag}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-rag}
QDRANT_URL: http://qdrant:6333
OPENAI_API_KEY: ${OPENAI_API_KEY:-}
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-}
COHERE_API_KEY: ${COHERE_API_KEY:-}
LANGSMITH_API_KEY: ${LANGSMITH_API_KEY:-}
JWT_SECRET: ${JWT_SECRET:?JWT_SECRET must be set for security}
API_KEY_SALT: ${API_KEY_SALT:?API_KEY_SALT must be set for API key authentication}
depends_on:
postgres:
condition: service_healthy
qdrant:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "python -c \"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://127.0.0.1:8000/health').status==200 else 1)\""]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
volumes:
postgres_data:
qdrant_data: