-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
202 lines (195 loc) · 5.74 KB
/
docker-compose.dev.yml
File metadata and controls
202 lines (195 loc) · 5.74 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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# Docker Compose configuration for VISTA development environment
# This file provides a complete containerized development setup with hot reload
# Usage: docker compose -f docker-compose.dev.yml up
services:
# PostgreSQL database
postgres:
image: postgres:15
container_name: vista_postgres_dev
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- "5433:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
networks:
- vista-dev
# MinIO S3-compatible object storage
minio:
image: minio/minio:latest
container_name: vista_minio_dev
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadminpassword
MINIO_SERVER_URL: http://localhost:9000
MINIO_BROWSER_REDIRECT_URL: http://localhost:9001
ports:
- "9000:9000"
- "9001:9001"
volumes:
- minio_data:/data
command: server /data --console-address ":9001"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
networks:
- vista-dev
# pgAdmin database management UI
pgadmin:
image: dpage/pgadmin4:latest
container_name: vista_pgadmin_dev
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
ports:
- "8080:80"
environment:
PGADMIN_DEFAULT_EMAIL: admin@admin.com
PGADMIN_DEFAULT_PASSWORD: admin
PGADMIN_CONFIG_SERVER_MODE: 'False'
PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED: 'False'
volumes:
- pgadmin_data:/var/lib/pgadmin
- ./pgadmin-servers.json:/pgadmin4/servers.json
depends_on:
- postgres
networks:
- vista-dev
# Backend development service (FastAPI)
backend-dev:
build:
context: .
dockerfile: Dockerfile.dev
target: backend-dev
container_name: vista_backend_dev
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
ports:
- "8000:8000"
volumes:
# Mount source code for hot reload (read-only)
- ./backend:/app/backend:ro
- ./pyproject.toml:/app/pyproject.toml:ro
- ./uv.lock:/app/uv.lock:ro
- ./.env:/app/.env:ro
# Persistent volumes for cache
- backend_cache:/app/.cache
environment:
# Database configuration (use container name for networking)
- DATABASE_URL=postgresql+asyncpg://postgres:postgres@postgres:5432/postgres
- POSTGRES_SERVER=postgres
- POSTGRES_PORT=5432
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
# S3/MinIO configuration (use container name)
- S3_ENDPOINT=minio:9000
- S3_ACCESS_KEY=minioadmin
- S3_SECRET_KEY=minioadminpassword
- S3_BUCKET=data-storage
- S3_USE_SSL=false
# Development mode settings
- DEBUG=true
- SKIP_HEADER_CHECK=true
- CHECK_MOCK_MEMBERSHIP=true
- MOCK_USER_EMAIL=test@example.com
- MOCK_USER_GROUPS_JSON=["admin-group", "data-scientists", "project-alpha-group"]
# Python settings
- PYTHONUNBUFFERED=1
- PYTHONDONTWRITEBYTECODE=1
# Disable file logging (use Docker logs instead)
- DISABLE_FILE_LOGGING=true
# Cache directory (writable volume)
- CACHE_DIR=/app/.cache
depends_on:
postgres:
condition: service_healthy
minio:
condition: service_healthy
command: >
bash -c "
cd /app/backend &&
echo 'Running database migrations...' &&
alembic upgrade head &&
echo 'Starting backend server with hot reload...' &&
uvicorn main:app --host 0.0.0.0 --port 8000 --reload
"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/api/health"]
interval: 10s
timeout: 5s
retries: 5
networks:
- vista-dev
# Frontend development service (React)
frontend-dev:
build:
context: .
dockerfile: Dockerfile.dev
target: frontend-dev
container_name: vista_frontend_dev
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
ports:
- "3000:3000"
volumes:
# Mount source for hot reload (read-only)
- ./frontend/src:/app/frontend/src:ro
- ./frontend/public:/app/frontend/public:ro
- ./frontend/package.json:/app/frontend/package.json:ro
- ./frontend/package-lock.json:/app/frontend/package-lock.json:ro
- ./frontend/config-overrides.js:/app/frontend/config-overrides.js:ro
# Named volume for node_modules (avoid host/container conflicts)
- frontend_node_modules:/app/frontend/node_modules
environment:
- HOST=0.0.0.0
- REACT_APP_API_URL=http://localhost:8000
- REACT_APP_BACKEND_URL=http://backend-dev:8000
- FAST_REFRESH=true
- SKIP_PREFLIGHT_CHECK=true
- WATCHPACK_POLLING=true
- CHOKIDAR_USEPOLLING=true
depends_on:
- backend-dev
stdin_open: true
tty: true
networks:
- vista-dev
# Named volumes for persistent data
volumes:
postgres_data:
minio_data:
pgadmin_data:
backend_cache:
frontend_node_modules:
# Network for all services
networks:
vista-dev:
driver: bridge