-
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.42 KB
/
docker-compose.yml
File metadata and controls
57 lines (53 loc) · 1.42 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
version: "3.9"
services:
db:
image: postgres:15
container_name: sda_postgres
restart: unless-stopped
environment:
POSTGRES_USER: ${DB_USER:-postgres}
POSTGRES_PASSWORD: ${DB_PASSWORD:-postgres}
POSTGRES_DB: ${DB_NAME:-school_analytics}
ports:
- "${DB_PORT:-5432}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./backend/db/migrations/001_init_schema.sql:/docker-entrypoint-initdb.d/01_schema.sql
- ./backend/db/seeds/seed_data.sql:/docker-entrypoint-initdb.d/02_seed.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-postgres} -d ${DB_NAME:-school_analytics}"]
interval: 5s
timeout: 5s
retries: 10
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: sda_backend
restart: unless-stopped
environment:
DB_HOST: db
DB_PORT: 5432
DB_USER: ${DB_USER:-postgres}
DB_PASSWORD: ${DB_PASSWORD:-postgres}
DB_NAME: ${DB_NAME:-school_analytics}
PORT: 4000
ports:
- "4000:4000"
depends_on:
db:
condition: service_healthy
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: sda_frontend
restart: unless-stopped
environment:
VITE_API_URL: ${VITE_API_URL:-http://localhost:4000}
ports:
- "3000:3000"
depends_on:
- backend
volumes:
postgres_data: