-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
47 lines (43 loc) · 977 Bytes
/
docker-compose.yml
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
version: '3.8'
services:
database:
container_name: bookrestapi_database
image: postgres:15
restart: on-failure
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
ports:
- "5432:5432"
volumes:
- bookrestapi_data:/var/lib/postgresql/data
- ./dbscripts/:/docker-entrypoint-initdb.d/
networks:
- bookrestapi_net
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 10s
timeout: 5s
retries: 5
server:
container_name: bookrestapi_server
build: .
depends_on:
database:
condition: service_healthy
restart: on-failure
networks:
- bookrestapi_net
ports:
- "8080:8080"
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8080/health" ]
interval: 10s
timeout: 5s
retries: 3
volumes:
bookrestapi_data:
driver: local
networks:
bookrestapi_net:
driver: bridge