-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yaml
44 lines (43 loc) · 1.07 KB
/
docker-compose.yaml
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
# Reason why stick to V2 not V3
# https://github.com/peter-evans/docker-compose-healthcheck/issues/3#issuecomment-329037485
version: '2.3'
networks:
backend:
driver: bridge
services:
api:
build:
context: .
dockerfile: dev.Dockerfile
container_name: todo-service
ports:
- 9090:9090
networks:
- backend
volumes:
- ./:/go_modules/LieAlbertTriAdrian/todo-service
env_file:
- .env
# NOTES: This features only available in V2.
# https://github.com/peter-evans/docker-compose-healthcheck/issues/3#issuecomment-329037485
depends_on:
postgres:
condition: service_healthy
postgres:
image: postgres:11.4-alpine
container_name: todo-service-postgres
ports:
- 5432:5432
volumes:
- ./tmp/postgres-data:/var/lib/postgresql/data
environment:
POSTGRES_USER: user
POSTGRES_DB: todo_app
POSTGRES_PASSWORD: password
networks:
- backend
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U postgres']
interval: 10s
timeout: 5s
retries: 5