-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
36 lines (34 loc) · 854 Bytes
/
Copy pathcompose.yaml
File metadata and controls
36 lines (34 loc) · 854 Bytes
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
services:
db:
image: postgres:16-alpine
ports:
- "5434:5432"
environment:
POSTGRES_DB: ${POSTGRES_DB:-library}
POSTGRES_USER: ${POSTGRES_USER:-library}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-library}
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 5s
timeout: 5s
retries: 12
start_period: 5s
app:
build:
context: .
ports:
- "${APP_PORT:-8080}:8080"
environment:
DB_HOST: db
DB_PORT: 5432
DB_NAME: ${POSTGRES_DB:-library}
DB_USERNAME: ${POSTGRES_USER:-library}
DB_PASSWORD: ${POSTGRES_PASSWORD:-library}
depends_on:
db:
condition: service_healthy
restart: unless-stopped
volumes:
postgres-data: