-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
38 lines (35 loc) · 857 Bytes
/
compose.yaml
File metadata and controls
38 lines (35 loc) · 857 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
name: invoicing
services:
postgres:
container_name: postgres
image: 'postgres:latest'
environment:
- 'POSTGRES_DB=invoices_db'
- 'POSTGRES_PASSWORD=postgres'
- 'POSTGRES_USER=postgres'
ports:
- '5432:5432'
volumes:
- postgres_data:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
app:
container_name: webapi
build:
context: .
dockerfile: Dockerfile
ports:
- '8080:8080'
environment:
- 'SPRING_DATASOURCE_URL=jdbc:postgresql://postgres:5432/invoices_db'
- 'SPRING_DATASOURCE_USERNAME=postgres'
- 'SPRING_DATASOURCE_PASSWORD=postgres'
depends_on:
postgres:
condition: service_healthy
restart: unless-stopped
volumes:
postgres_data: