-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
59 lines (54 loc) · 1.35 KB
/
Copy pathdocker-compose.yml
File metadata and controls
59 lines (54 loc) · 1.35 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
version: "3.9"
# Default: Postgres only.
# For Ollama: docker compose --profile ollama up
services:
postgres:
image: postgres:16-alpine
container_name: second-opinion-postgres
environment:
POSTGRES_DB: second_opinion
POSTGRES_USER: second_opinion
POSTGRES_PASSWORD: second_opinion
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U second_opinion"]
interval: 10s
timeout: 5s
retries: 5
ollama:
profiles: ["ollama"]
image: ollama/ollama:latest
container_name: second-opinion-ollama
ports:
- "11434:11434"
volumes:
- ollama_models:/root/.ollama
healthcheck:
test: ["CMD", "curl", "-fsS", "http://localhost:11434/api/tags"]
interval: 15s
timeout: 5s
retries: 20
start_period: 10s
ollama-init:
profiles: ["ollama"]
image: ollama/ollama:latest
container_name: second-opinion-ollama-init
depends_on:
ollama:
condition: service_healthy
entrypoint: ["/bin/sh", "-lc"]
command: >
"ollama pull ${OLLAMA_MODEL:-llama3} || true"
environment:
- OLLAMA_HOST=http://ollama:11434
volumes:
- ollama_models:/root/.ollama
restart: "no"
volumes:
postgres_data:
driver: local
ollama_models:
driver: local