-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDocker-compose.yml
More file actions
107 lines (100 loc) · 3.62 KB
/
Copy pathDocker-compose.yml
File metadata and controls
107 lines (100 loc) · 3.62 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
services:
# ─────────────────────────────────────────────
# OLLAMA — LLM inference server
# ─────────────────────────────────────────────
ollama:
image: ollama/ollama:latest
container_name: ollama
ports:
- "11434:11434"
volumes:
- ollama_data:/root/.ollama
command: ["serve"]
# ─────────────────────────────────────────────
# OLLAMA INIT — pulls phi3:mini once on startup
# Runs once and exits (restart: no)
# ─────────────────────────────────────────────
ollama-init:
image: curlimages/curl:latest
container_name: ollama_init
restart: "no"
depends_on:
- ollama
entrypoint: >
sh -c "
echo 'Waiting for ollama...' &&
sleep 10 &&
curl -X POST http://ollama:11434/api/pull
-H 'Content-Type: application/json'
-d '{\"name\":\"phi3:mini\"}'
"
# ─────────────────────────────────────────────
# REDIS — Celery broker + result backend
# ─────────────────────────────────────────────
redis:
image: redis:7
container_name: redis_server
ports:
- "6379:6379"
volumes:
- redis_data:/data
command: redis-server --appendonly yes
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
# ─────────────────────────────────────────────
# BACKEND — FastAPI app
# ─────────────────────────────────────────────
backend:
build: ./Backend
container_name: backend
ports:
- "8000:8000"
volumes:
- ./Backend/app:/app/app
- db_data:/app/data
depends_on:
- redis
- ollama
environment:
- OLLAMA_BASE=http://ollama:11434
- REDIS_URL=redis://redis_server:6379/0
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
# ─────────────────────────────────────────────
# CELERY WORKER — async proposal scoring
# ─────────────────────────────────────────────
worker:
build: ./Backend
container_name: celery_worker
command: >
celery -A app.celery_app worker
-Q pdf_queue,notification_queue
--concurrency=4
--loglevel=info
volumes:
- ./Backend/app:/app/app
- db_data:/app/data
depends_on:
- redis
- ollama
environment:
- OLLAMA_BASE=http://ollama:11434
- REDIS_URL=redis://redis_server:6379/0
restart: on-failure
# FRONTEND — Nginx static / React build
# ─────────────────────────────────────────────
frontend:
build: ./frontend
container_name: frontend
ports:
- "3000:80"
depends_on:
- backend
volumes:
- ./frontend:/usr/share/nginx/html
volumes:
ollama_data:
redis_data:
db_data: