-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
158 lines (149 loc) · 3.85 KB
/
docker-compose.yml
File metadata and controls
158 lines (149 loc) · 3.85 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
version: '3.8'
services:
# PostgreSQL Database
postgres:
image: postgres:15-alpine
container_name: benchhub_postgres
environment:
POSTGRES_DB: benchhub_plus
POSTGRES_USER: benchhub
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-benchhub_password}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U benchhub -d benchhub_plus"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
# Redis for Celery
redis:
image: redis:7-alpine
container_name: benchhub_redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
# FastAPI Backend
backend:
build:
context: .
dockerfile: Dockerfile.backend
container_name: benchhub_backend
environment:
- DATABASE_URL=postgresql://benchhub:${POSTGRES_PASSWORD:-benchhub_password}@postgres:5432/benchhub_plus
- REDIS_URL=redis://redis:6379/0
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
- OPENAI_API_KEY=${OPENAI_API_KEY}
- API_HOST=0.0.0.0
- API_PORT=8000
- DEBUG=false
- LOG_LEVEL=info
- FRONTEND_URL=http://localhost:3000
ports:
- "8000:8000"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ./logs:/app/logs
restart: unless-stopped
# Celery Worker
worker:
build:
context: .
dockerfile: Dockerfile.worker
args:
HRET_PREFETCH_MODEL: ${HRET_PREFETCH_MODEL:-}
HRET_PREFETCH_REVISION: ${HRET_PREFETCH_REVISION:-}
container_name: benchhub_worker
environment:
- DATABASE_URL=postgresql://benchhub:${POSTGRES_PASSWORD:-benchhub_password}@postgres:5432/benchhub_plus
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
- OPENAI_API_KEY=${OPENAI_API_KEY}
- DEBUG=false
- LOG_LEVEL=info
- HF_HOME=/app/.cache/huggingface
- TRANSFORMERS_CACHE=/app/.cache/huggingface
- HF_HUB_DISABLE_TELEMETRY=1
- TOKENIZERS_PARALLELISM=false
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
backend:
condition: service_started
volumes:
- ./logs:/app/logs
- /tmp:/tmp # For temporary files during evaluation
- hf_cache:/app/.cache/huggingface
restart: unless-stopped
# Reflex Frontend
reflex:
build:
context: .
dockerfile: Dockerfile.reflex
container_name: benchhub_reflex
environment:
- API_BASE_URL=http://backend:8000
ports:
- "3000:3000"
- "8002:8002"
depends_on:
- backend
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"]
interval: 30s
timeout: 10s
retries: 5
restart: unless-stopped
# Celery Flower (Optional - for monitoring)
flower:
image: mher/flower:0.9.7
container_name: benchhub_flower
environment:
- CELERY_BROKER_URL=redis://redis:6379/0
- FLOWER_PORT=5555
ports:
- "5555:5555"
depends_on:
- redis
restart: unless-stopped
# Nginx Reverse Proxy (Optional)
nginx:
image: nginx:alpine
container_name: benchhub_nginx
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./ssl:/etc/nginx/ssl:ro
depends_on:
- backend
- reflex
restart: unless-stopped
volumes:
postgres_data:
driver: local
redis_data:
driver: local
hf_cache:
driver: local
networks:
default:
name: benchhub_network