-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
106 lines (100 loc) · 2.45 KB
/
docker-compose.yml
File metadata and controls
106 lines (100 loc) · 2.45 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
version: '3.8'
services:
redis:
image: redis:7-alpine
container_name: treerag-redis
ports:
- "6379:6379"
volumes:
- redis-data:/data
networks:
- treerag-network
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 3
command: redis-server --appendonly yes
backend:
build:
context: .
dockerfile: Dockerfile
container_name: treerag-backend
ports:
- "8000:8000"
environment:
- GOOGLE_API_KEY=${GOOGLE_API_KEY}
- USE_DEEP_TRAVERSAL=true
- MAX_TRAVERSAL_DEPTH=5
- MAX_BRANCHES_PER_LEVEL=3
- REDIS_URL=redis://redis:6379/0
volumes:
- ./data:/app/data
- ./src:/app/src
networks:
- treerag-network
restart: unless-stopped
depends_on:
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "python", "-c", "import requests; requests.get('http://localhost:8000/api/')"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
celery-worker:
build:
context: .
dockerfile: Dockerfile
container_name: treerag-celery-worker
command: celery -A src.celery_app worker --loglevel=info --queues=default,indexing --concurrency=2
environment:
- GOOGLE_API_KEY=${GOOGLE_API_KEY}
- REDIS_URL=redis://redis:6379/0
volumes:
- ./data:/app/data
- ./src:/app/src
networks:
- treerag-network
restart: unless-stopped
depends_on:
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "celery", "-A", "src.celery_app", "inspect", "ping"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
frontend:
build:
context: .
dockerfile: Dockerfile.frontend
container_name: treerag-frontend
ports:
- "3000:3000"
environment:
- NODE_ENV=production
- NEXT_PUBLIC_API_BASE_URL=http://backend:8000/api
depends_on:
backend:
condition: service_healthy
networks:
- treerag-network
restart: unless-stopped
healthcheck:
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000', (res) => process.exit(res.statusCode === 200 ? 0 : 1))"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
networks:
treerag-network:
driver: bridge
volumes:
data:
driver: local
redis-data:
driver: local