This repository was archived by the owner on Mar 15, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
60 lines (56 loc) · 1.48 KB
/
docker-compose.yml
File metadata and controls
60 lines (56 loc) · 1.48 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
# Local development — mirrors the production topology exactly.
# Run: docker compose up --build
#
# Services:
# ui → http://localhost:3000 (Vite dev server with HMR)
# api → http://localhost:8000 (FastAPI with auto-reload)
# db → localhost:5432 (PostgreSQL 16)
services:
ui:
build:
context: ./ui
target: build # stop at the Node build stage — Vite dev server below
image: react-fastapi-postgres-ui:dev
working_dir: /app
command: npm run dev -- --host 0.0.0.0 --port 3000
ports:
- "3000:3000"
volumes:
- ./ui:/app
- /app/node_modules # preserve container node_modules
environment:
VITE_API_URL: http://localhost:8000
depends_on:
- api
api:
build:
context: ./api
image: react-fastapi-postgres-api:dev
command: uvicorn main:app --host 0.0.0.0 --port 8000 --reload
ports:
- "8000:8000"
volumes:
- ./api:/app
environment:
DATABASE_URL: postgresql://rusha:rusha@db:5432/rusha
SECRET_KEY: dev-secret-change-in-production
depends_on:
db:
condition: service_healthy
db:
image: postgres:16-alpine
ports:
- "5432:5432"
environment:
POSTGRES_USER: rusha
POSTGRES_PASSWORD: rusha
POSTGRES_DB: rusha
volumes:
- db_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U rusha"]
interval: 5s
timeout: 5s
retries: 5
volumes:
db_data: