Repository navigation
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
161 lines (153 loc) · 3.88 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
161 lines (153 loc) · 3.88 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
159
160
161
version: '3.8'
services:
# Development application with hot reload
app-dev:
build:
context: .
dockerfile: Dockerfile.dev
ports:
- "8000:8000"
environment:
- ENVIRONMENT=development
- DATABASE_URL=postgresql://postgres:postgres@postgres:5432/gpu_platform
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
- REDIS_URL=redis://redis:6379/0
- MLFLOW_TRACKING_URI=http://mlflow:5000
- SECRET_KEY=dev-secret-key-change-in-production
- DEBUG=true
- PYTHONPATH=/app
volumes:
- .:/app
- /app/frontend/node_modules # Prevent overwriting node_modules
- gpu_data:/app/data
depends_on:
- postgres
- redis
restart: unless-stopped
networks:
- gpu-platform
command: >
bash -c "
echo 'Waiting for database...' &&
sleep 10 &&
echo 'Running database migrations...' &&
alembic upgrade head &&
echo 'Starting development server with hot reload...' &&
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
"
# Frontend development server
frontend-dev:
build:
context: ./frontend
dockerfile: Dockerfile.dev
ports:
- "3000:3000"
volumes:
- ./frontend:/app
- /app/node_modules
environment:
- NODE_ENV=development
- VITE_API_BASE_URL=http://localhost:8000
restart: unless-stopped
networks:
- gpu-platform
command: npm run dev -- --host 0.0.0.0
# Development Celery worker
celery-dev:
build:
context: .
dockerfile: Dockerfile.dev
command: >
bash -c "
echo 'Waiting for Redis and database...' &&
sleep 15 &&
echo 'Starting Celery worker...' &&
celery -A app.core.celery_app.celery_app worker -Q default,gpu_tasks -l info --concurrency=2
"
environment:
- ENVIRONMENT=development
- DATABASE_URL=postgresql://postgres:postgres@postgres:5432/gpu_platform
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
- REDIS_URL=redis://redis:6379/0
- MLFLOW_TRACKING_URI=http://mlflow:5000
- PYTHONPATH=/app
volumes:
- .:/app
- gpu_data:/app/data
depends_on:
- postgres
- redis
restart: unless-stopped
networks:
- gpu-platform
# PostgreSQL database
postgres:
image: postgres:15-alpine
environment:
- POSTGRES_DB=gpu_platform
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
restart: unless-stopped
networks:
- gpu-platform
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
# Redis for caching and task queue
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redis_data:/data
restart: unless-stopped
networks:
- gpu-platform
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 5
# Jupyter notebook for development and experiments (optional)
jupyter:
build:
context: .
dockerfile: Dockerfile.dev
ports:
- "8888:8888"
environment:
- ENVIRONMENT=development
- DATABASE_URL=postgresql://postgres:postgres@postgres:5432/gpu_platform
- JUPYTER_ENABLE_LAB=yes
volumes:
- .:/app
- jupyter_data:/home/appuser/.jupyter
command: >
bash -c "
jupyter lab --ip=0.0.0.0 --port=8888 --no-browser --allow-root
"
restart: unless-stopped
networks:
- gpu-platform
profiles:
- jupyter
volumes:
postgres_data:
driver: local
redis_data:
driver: local
gpu_data:
driver: local
jupyter_data:
driver: local
networks:
gpu-platform:
driver: bridge