-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcompose.yaml
More file actions
62 lines (57 loc) · 1.75 KB
/
Copy pathcompose.yaml
File metadata and controls
62 lines (57 loc) · 1.75 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
name: vibudget
services:
db:
image: postgres:17-alpine
environment:
POSTGRES_USER: ${POSTGRES_USER:-vibudget}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-vibudget}
POSTGRES_DB: ${POSTGRES_DB:-vibudget}
volumes:
- db-data:/var/lib/postgresql/data
# Not published: only the backend talks to it, over the compose network.
# The dev overlay exposes it on DB_PORT for psql.
healthcheck:
test:
["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-vibudget} -d ${POSTGRES_DB:-vibudget}"]
interval: 5s
timeout: 3s
retries: 12
restart: unless-stopped
backend:
build:
context: ./backend
environment:
DATABASE_URL: postgresql://${POSTGRES_USER:-vibudget}:${POSTGRES_PASSWORD:-vibudget}@db:5432/${POSTGRES_DB:-vibudget}
DB_POOL_MIN_SIZE: ${DB_POOL_MIN_SIZE:-1}
DB_POOL_MAX_SIZE: ${DB_POOL_MAX_SIZE:-10}
VIBUDGET_MIGRATE_ON_STARTUP: ${VIBUDGET_MIGRATE_ON_STARTUP:-true}
VIBUDGET_DEBUG: ${VIBUDGET_DEBUG:-false}
depends_on:
db:
condition: service_healthy
ports:
- "${BACKEND_PORT:-8000}:8000"
restart: unless-stopped
seed:
image: postgres:17-alpine
environment:
PGPASSWORD: ${POSTGRES_PASSWORD:-vibudget}
volumes:
- ./scripts/seed_demo.sql:/seed_demo.sql:ro
command:
["psql", "-v", "ON_ERROR_STOP=1", "-h", "db", "-U", "${POSTGRES_USER:-vibudget}", "-d", "${POSTGRES_DB:-vibudget}", "-f", "/seed_demo.sql"]
depends_on:
backend:
condition: service_healthy
restart: "no"
frontend:
build:
context: ./frontend
depends_on:
seed:
condition: service_completed_successfully
ports:
- "${WEB_PORT:-8080}:80"
restart: unless-stopped
volumes:
db-data: