-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
41 lines (39 loc) · 943 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
services:
java_app:
container_name: java_app
build: .
ports:
- 8080:8080
environment:
- DATABASE_URL=jdbc:postgresql://java_db:5432/prod_db
- DATABASE_USERNAME=postgres
- DATABASE_PASSWORD=postgres
- SPRING_PROFILES_ACTIVE=online
depends_on:
java_db:
condition: service_healthy
healthcheck:
test: [ "CMD", "curl", "-f", "https://localhost:8080/actuator/health" ]
interval: 10s
timeout: 5s
retries: 3
start_period: 40s
java_db:
container_name: java_db
image: postgres:12
ports:
- 5432:5432
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: prod_db
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 5s
timeout: 5s
retries: 5
start_period: 10s
volumes:
pgdata: {}