-
Notifications
You must be signed in to change notification settings - Fork 39
/
docker-compose.yml
45 lines (41 loc) · 1.1 KB
/
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
version: '3.9'
services:
# Postgres database
postgres-db:
image: postgres:alpine
restart: always
ports:
- '5432:5432'
environment:
POSTGRES_DB: spring_boot_starter
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- postgres-data:/var/lib/postgresql/data
# App backend service
spring-boot-starter:
image: ericus20/spring-boot-starter
build:
context: .
dockerfile: Dockerfile
ports:
- '8080:8080'
restart: always
depends_on:
- postgres-db
environment:
- SPRING_PROFILES_ACTIVE=docker
- SPRING_DATASOURCE_URL=jdbc:postgresql://postgres-db:5432/spring_boot_starter
- SPRING_DATASOURCE_USERNAME=postgres
- SPRING_DATASOURCE_PASSWORD=postgres
- SPRING_DATASOURCE_DRIVER_CLASS_NAME=org.postgresql.Driver
healthcheck:
test: "curl --fail --silent localhost:8080/actuator/health | grep UP || exit 1"
interval: 20s
timeout: 5s
retries: 5
start_period: 40s
# Volumes
volumes:
postgres-data:
driver: local