-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
64 lines (59 loc) · 1.62 KB
/
docker-compose.dev.yml
File metadata and controls
64 lines (59 loc) · 1.62 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
version: "3.9"
services:
# Backend in dev mode: hot reload with uvicorn and live code mount
backend:
profiles: ["dev"]
build:
context: ./Backend
dockerfile: Dockerfile
ports:
- "8000:8000"
depends_on:
- db
volumes:
- ./Backend:/app
command: sh -c "uvicorn main:app --host 0.0.0.0 --port 8000 --reload"
environment:
WATCHFILES_FORCE_POLLING: "true" # more reliable file watching under Docker on Windows
PYTHONUNBUFFERED: "1"
DB_HOST: db
DB_PORT: 5432
DB_NAME: B_trust
DB_USER: postgres
DB_PASSWORD: 1234
DB_SSLMODE: disable
# Keep the original NGINX-based frontend only for prod profile
frontend:
profiles: ["prod"]
# Frontend in dev mode: Vite HMR with code mount
frontend-dev:
profiles: ["dev"]
image: node:20-alpine
working_dir: /app
volumes:
- ./Frontend:/app
- frontend-node_modules:/app/node_modules
ports:
- "5173:5173"
environment:
CHOKIDAR_USEPOLLING: "true" # ensures file changes are detected inside Docker on Windows
VITE_DEV_SERVER_HOST: 0.0.0.0
VITE_DEV_SERVER_PORT: "5173"
depends_on:
- backend
command: sh -c "npm install && npm run dev -- --host 0.0.0.0 --port 5173"
# Database service (needed by backend)
db:
image: postgres:15-alpine
environment:
POSTGRES_DB: B_trust
POSTGRES_USER: postgres
POSTGRES_PASSWORD: 1234
volumes:
- postgres_data:/var/lib/postgresql/data
- ./init-scripts:/docker-entrypoint-initdb.d
ports:
- "5432:5432"
volumes:
frontend-node_modules:
postgres_data: