-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
89 lines (82 loc) · 2.55 KB
/
Copy pathdocker-compose.yml
File metadata and controls
89 lines (82 loc) · 2.55 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
81
82
83
84
85
86
87
88
89
version: "3.9"
services:
api:
build:
context: .
dockerfile: docker/Dockerfile.api
ports:
- "8000:8000"
volumes:
- .:/app # mount source for hot reload in dev
- model-cache:/root/.cache # persist HuggingFace + sentence-transformers caches
environment:
- DATABASE_URL=postgresql://sentinel:sentinel@postgres:5432/sentinellm
- REDIS_URL=redis://redis:6379/0
- SENTINEL_CONFIG_PATH=/app/config.yaml
- SENTINEL_ENV=development
# Optional: set in .env to enable auth / configure CORS in dev
- SENTINEL_API_KEY=${SENTINEL_API_KEY:-}
- SENTINEL_CORS_ORIGINS=${SENTINEL_CORS_ORIGINS:-http://localhost:3000,http://127.0.0.1:3000}
# LLM API keys — set in .env the one matching llm_backend.provider in config.yaml
- GEMINI_API_KEY=${GEMINI_API_KEY:-}
- OPENAI_API_KEY=${OPENAI_API_KEY:-}
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
command: uvicorn sentinel.main:app --host 0.0.0.0 --port 8000 --reload
dashboard:
build:
context: ./dashboard
dockerfile: ../docker/Dockerfile.dashboard
ports:
- "3000:3000"
environment:
- NEXT_PUBLIC_API_URL=http://localhost:8000
- NEXT_PUBLIC_WS_URL=ws://localhost:8000
depends_on:
- api
postgres:
image: postgres:15-alpine
environment:
POSTGRES_USER: sentinel
POSTGRES_PASSWORD: sentinel
POSTGRES_DB: sentinellm
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
- ./sentinel/storage/schema.sql:/docker-entrypoint-initdb.d/schema.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U sentinel -d sentinellm"]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
# ── Ollama (optional — only needed when llm_backend.provider: ollama) ──────
# Start with: docker compose --profile ollama up
# Pull model: docker compose exec ollama ollama pull llama3.2
ollama:
image: ollama/ollama:latest
ports:
- "11434:11434"
volumes:
- ollama-models:/root/.ollama
profiles: [ollama]
volumes:
postgres-data:
redis-data:
ollama-models:
model-cache: # shared cache for HuggingFace + sentence-transformers models