forked from gorbadil/LibraryAppSpringBoot
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
28 lines (27 loc) · 759 Bytes
/
Copy pathdocker-compose.yaml
File metadata and controls
28 lines (27 loc) · 759 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
services:
springboot-app:
build: .
ports:
- "8080:8080"
depends_on:
- postgres
environment:
DBURL: ${DBURL:-postgres:5432}
DBNAME: ${DBNAME:-library-app}
DBUSERNAME: ${DBUSERNAME:?set DBUSERNAME in .env}
DBPASSWORD: ${DBPASSWORD:?set DBPASSWORD in .env}
postgres:
image: postgres:16-alpine
ports:
- 5432:5432
environment:
POSTGRES_USER: ${DBUSERNAME:?set DBUSERNAME in .env}
POSTGRES_PASSWORD: ${DBPASSWORD:?set DBPASSWORD in .env}
POSTGRES_DB: ${DBNAME:-library-app}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 10
volumes:
- /var/lib/postgresql/data