-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
38 lines (37 loc) · 830 Bytes
/
compose.yaml
File metadata and controls
38 lines (37 loc) · 830 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
37
38
version: '3.8'
services:
db:
image: postgres:15.4-alpine
ports:
- 5432:5432
restart: always
container_name: db
environment:
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=1234
- POSTGRES_DB=mydb
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 20s
timeout: 5s
retries: 10
volumes:
- psqlvolume:/var/lib/postgresql/data
app:
environment:
- SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/mydb
- SPRING_DATASOURCE_USERNAME=admin
- SPRING_DATASOURCE_PASSWORD=1234
- SPRING_JPA_HIBERNATE_DDL_AUTO=update
build:
context:
./
image: app:1.0
ports:
- 8080:8080
container_name: app
depends_on:
db:
condition: service_healthy
volumes:
psqlvolume: