Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
139 lines (133 loc) · 4.08 KB
/
Copy pathdocker-compose.yml
File metadata and controls
139 lines (133 loc) · 4.08 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
services:
postgres:
image: postgres:16-alpine
container_name: lcqdrag-postgres
environment:
POSTGRES_USER: temporal
POSTGRES_PASSWORD: temporal
POSTGRES_DB: temporal
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U temporal -d temporal"]
interval: 3s
timeout: 3s
retries: 20
start_period: 10s
networks:
- lcqdrag-net
temporal:
image: temporalio/auto-setup:latest
container_name: lcqdrag-temporal
depends_on:
postgres:
condition: service_healthy # auto-setup requires DB live before init scripts run
ports:
- "7233:7233" # gRPC (SDK client + workers)
- "8233:8233" # Temporal Web UI
environment:
- DB=postgres12
- POSTGRES_SEEDS=postgres # resolves to the `postgres` service on lcqdrag-net
- POSTGRES_USER=temporal
- POSTGRES_PWD=temporal
- DBNAME=temporal # schema for workflow history / namespaces / task queues
- VISIBILITY_DBNAME=temporal # schema for UI / list-workflows queries
- DB_PORT=5432
- TEMPORAL_ADDRESS=0.0.0.0:7233
- DEFAULT_NAMESPACE=default
- SKIP_DEFAULT_NAMESPACE_CREATION=false
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:7233/ 2>&1 | head -1 || exit 1"]
interval: 10s
timeout: 5s
retries: 15
start_period: 40s
networks:
- lcqdrag-net
qdrant:
image: qdrant/qdrant:latest
container_name: lcqdrag-qdrant
ports:
- "6333:6333"
- "6334:6334"
volumes:
- qdrant_storage:/qdrant/storage
healthcheck:
test:
- CMD
- bash
- -c
- 'exec 3<>/dev/tcp/localhost/6333 && printf ''GET /readyz HTTP/1.0\r\nHost: localhost\r\n\r\n'' >&3 && head -n 1 <&3 | grep -q ''200 OK'''
interval: 5s
timeout: 3s
retries: 10
start_period: 5s
networks:
- lcqdrag-net
ollama:
profiles: ["with-ollama"]
image: ollama/ollama:latest
container_name: lcqdrag-ollama
ports:
- "11435:11434" # host 11435 → container 11434, so native ollama can keep :11434
volumes:
- ollama_models:/root/.ollama
healthcheck:
# ollama/ollama image ships bash but no curl; use /dev/tcp HTTP probe
test:
- CMD-SHELL
- |
exec 3<>/dev/tcp/localhost/11434 && \
printf 'GET /api/tags HTTP/1.0\r\nHost: localhost\r\n\r\n' >&3 && \
head -n 1 <&3 | grep -q '200 OK'
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
entrypoint: ["/bin/bash", "-c"]
command: >
"ollama serve &
sleep 8 &&
(ollama list | grep -q bge-large || ollama pull bge-large) &
wait"
networks:
- lcqdrag-net
worker:
profiles: ["worker"]
build:
context: .
dockerfile: Dockerfile
container_name: lcqdrag-worker
extra_hosts:
# Allow the dockerized worker to reach a HOST-NATIVE ollama on
# localhost:11434 via hostname `host.docker.internal:11434`.
# This is the DEFAULT path — ollama container is off-by-default.
- "host.docker.internal:host-gateway"
environment:
- GROQ_API_KEY=${GROQ_API_KEY}
- QDRANT_URL=http://qdrant:6333
- TEMPORAL_HOST=temporal:7233
# Default: HOST-NATIVE ollama (already running, bge-large already pulled).
# Swap to http://ollama:11434 only if you opted in with
# docker compose --profile with-ollama --profile worker up -d
- OLLAMA_HOST=http://host.docker.internal:11434
depends_on:
temporal:
condition: service_healthy
qdrant:
condition: service_healthy
# ollama removed from depends_on: with the host-native default.
# If you enable --profile with-ollama, also uncomment the line below:
# ollama:
# condition: service_healthy
command: ["python", "worker.py"]
restart: unless-stopped
networks:
- lcqdrag-net
networks:
lcqdrag-net:
driver: bridge
volumes:
postgres_data:
qdrant_storage:
ollama_models: