-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
57 lines (53 loc) · 1.53 KB
/
Copy pathdocker-compose.yml
File metadata and controls
57 lines (53 loc) · 1.53 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
services:
db:
image: postgres:16-alpine
environment:
POSTGRES_DB: data_lens
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- postgres_data:/var/lib/postgresql/data
# Run initial schema on first start (only when data dir is empty)
- ./migrations/001_initial_schema.sql:/docker-entrypoint-initdb.d/001_initial_schema.sql:ro
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d data_lens"]
interval: 5s
timeout: 5s
retries: 10
app:
build: .
environment:
DATABASE_URL: postgresql://postgres:postgres@db:5432/data_lens
ports:
- "8000:8000"
depends_on:
db:
condition: service_healthy
# Restart on crash (e.g. if DB wasn't fully ready)
restart: on-failure
# Seeds the demo account (user_id=1) and three sample datasets on first run.
# Idempotent: exits immediately if data already exists.
seeder:
build: .
environment:
DATABASE_URL: postgresql://postgres:postgres@db:5432/data_lens
command: python scripts/seed_demo.py
depends_on:
db:
condition: service_healthy
restart: "no"
# React frontend served by nginx.
# The browser calls the API directly at localhost:8000, so VITE_API_URL stays
# at its default (http://localhost:8000) — no extra config needed for local use.
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
ports:
- "3000:80"
depends_on:
- app
volumes:
postgres_data: