-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
148 lines (140 loc) · 3.9 KB
/
docker-compose.dev.yml
File metadata and controls
148 lines (140 loc) · 3.9 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
version: '3.8'
services:
# PostgreSQL Database
postgres:
image: postgres:15-alpine
container_name: benchhub_postgres_dev
environment:
POSTGRES_DB: benchhub_plus_dev
POSTGRES_USER: benchhub
POSTGRES_PASSWORD: dev_password
volumes:
- postgres_dev_data:/var/lib/postgresql/data
ports:
- "5433:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U benchhub -d benchhub_plus_dev"]
interval: 10s
timeout: 5s
retries: 5
# Redis for Celery
redis:
image: redis:7-alpine
container_name: benchhub_redis_dev
ports:
- "6380:6379"
volumes:
- redis_dev_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
# FastAPI Backend (Development)
backend:
build:
context: .
dockerfile: Dockerfile.backend
container_name: benchhub_backend_dev
environment:
- DATABASE_URL=postgresql://benchhub:dev_password@postgres:5432/benchhub_plus_dev
- 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=true
- LOG_LEVEL=debug
- FRONTEND_URL=http://localhost:3000
- DEV_AUTH_BYPASS=true
ports:
- "8001:8000"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- .:/app # Mount source code for development
- ./logs:/app/logs
command: ["python", "-m", "uvicorn", "apps.backend.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
# Celery Worker (Development)
worker:
build:
context: .
dockerfile: Dockerfile.worker
args:
HRET_PREFETCH_MODEL: ${HRET_PREFETCH_MODEL:-}
HRET_PREFETCH_REVISION: ${HRET_PREFETCH_REVISION:-}
container_name: benchhub_worker_dev
environment:
- DATABASE_URL=postgresql://benchhub:dev_password@postgres:5432/benchhub_plus_dev
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
- OPENAI_API_KEY=${OPENAI_API_KEY}
- DEBUG=true
- LOG_LEVEL=debug
- 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
volumes:
- .:/app # Mount source code for development
- ./logs:/app/logs
- /tmp:/tmp
- hf_cache:/app/.cache/huggingface
command: ["python", "-m", "celery", "-A", "apps.worker.celery_app", "worker", "--loglevel=debug", "--concurrency=1", "--queues", "evaluation,maintenance"]
# Next.js Frontend (Development)
web:
build:
context: .
dockerfile: Dockerfile.web
container_name: benchhub_web_dev
environment:
- NEXT_PUBLIC_API_BASE_URL=http://localhost:8001
ports:
- "3000:3000"
depends_on:
- backend
volumes:
- ./apps/web:/app
- web_dev_node_modules:/app/node_modules
- web_dev_next:/app/.next
command: ["npm", "run", "dev", "--", "--hostname", "0.0.0.0"]
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:3000"]
interval: 30s
timeout: 10s
start_period: 120s
retries: 5
# Celery Flower (Development)
flower:
image: mher/flower:0.9.7
container_name: benchhub_flower_dev
environment:
- CELERY_BROKER_URL=redis://redis:6379/0
- FLOWER_PORT=5555
ports:
- "5556:5555"
depends_on:
- redis
volumes:
postgres_dev_data:
driver: local
redis_dev_data:
driver: local
hf_cache:
driver: local
web_dev_node_modules:
driver: local
web_dev_next:
driver: local
networks:
default:
name: benchhub_dev_network