-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
80 lines (75 loc) · 2.36 KB
/
docker-compose.prod.yml
File metadata and controls
80 lines (75 loc) · 2.36 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
78
79
80
version: '3.8'
services:
# --------------------------------------------------------------------------
# 1. Reverse Proxy (Caddy) - Automatic HTTPS
# --------------------------------------------------------------------------
caddy:
image: caddy:2-alpine
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- caddy_data:/data
- caddy_config:/config
command: caddy reverse-proxy --from https://${DOMAIN_NAME} --to http://app:8000
# --------------------------------------------------------------------------
# 2. Application (FastAPI + Worker)
# --------------------------------------------------------------------------
app:
build:
context: .
dockerfile: Dockerfile
target: runtime
restart: always
env_file: .env
environment:
- ENABLE_EMBEDDED_WORKER=true
- QDRANT_URL=http://qdrant:6333
volumes:
- data_uploads:/app/data/uploads
- data_audio:/app/data/audio_output
- hf_cache:/app/.cache/huggingface # Persist downloaded models
- fastembed_cache:/app/.cache/fastembed
depends_on:
db:
condition: service_healthy
qdrant:
condition: service_started
# Resources: Uncapped access to host CPU/RAM is default in Docker, which is what we want for VPS
# --------------------------------------------------------------------------
# 3. Database (Postgres)
# --------------------------------------------------------------------------
db:
image: postgres:15-alpine
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD must be set}
POSTGRES_DB: notebookllm
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
# --------------------------------------------------------------------------
# 4. Vector DB (Qdrant)
# --------------------------------------------------------------------------
qdrant:
image: qdrant/qdrant:v1.7.4
restart: always
expose:
- "6333" # Internal only — not exposed to host in production
volumes:
- qdrant_data:/qdrant/storage
volumes:
postgres_data:
qdrant_data:
caddy_data:
caddy_config:
data_uploads:
data_audio:
hf_cache:
fastembed_cache: