-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
55 lines (51 loc) · 1.08 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
46
47
48
49
50
51
52
53
54
version: '3.8'
networks:
backend:
name: app
driver: bridge
services:
demo:
build: ./
image: demo:latest
restart: always
container_name: demo
ports:
- 8686:8686
networks:
- backend
environment:
- POSTGRES_HOST=db
- POSTGRES_PORT=5432
- POSTGRES_DB=demo
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- ACTIVE_PROFILE=dev
volumes:
- ./workdir:/workdir
depends_on:
- db
healthcheck:
test: curl -f http://localhost:8686/demo/api/v1/actuator/health || exit 1
interval: 1m
timeout: 10s
retries: 2
db:
image: postgres:12
container_name: postgres-db
restart: always
volumes:
- ./postgres_data:/var/lib/postgresql/data
networks:
- backend
ports:
- "5432:5432"
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: demo
PGDATA: /var/lib/postgresql/data/pgdata
healthcheck:
test: pg_isready -U postgres
interval: 1m
timeout: 10s
retries: 2