-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
44 lines (42 loc) · 1.09 KB
/
docker-compose.yml
File metadata and controls
44 lines (42 loc) · 1.09 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
version: '3.8'
services:
topic-hub:
build: .
ports:
- "8000:8000"
volumes:
- ./data:/app/data
environment:
- DATABASE_URL=sqlite:///data/topic_hub.db
- QUEUE_URL=sqlite:///data/queue/task_queue.db
- CACHE_DIR=/app/data/cache
- SCHEDULER_ENABLED=true
- FETCH_INTERVAL_MINUTES=5
- DATA_RETENTION_DAYS=30
restart: unless-stopped
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
# Optional: CLI service for scheduled fetching
topic-hub-cli:
build: .
volumes:
- ./data:/app/data
environment:
- DATABASE_URL=sqlite:///data/topic_hub.db
command: >
sh -c "
while true; do
echo 'Running scheduled fetch...';
python -m cli.main fetch weibo baidu --db --db-url sqlite:///data/topic_hub.db || true;
sleep 300;
done
"
depends_on:
- topic-hub
restart: unless-stopped
profiles:
- cli