-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
63 lines (59 loc) · 1.28 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
55
56
57
58
59
60
61
62
63
services:
app:
build:
context: .
dockerfile: Dockerfile_app
container_name: app
environment:
POSTGRES_DB_NAME: ${DB_NAME}
POSTGRES_DB_USER: ${DB_USER}
POSTGRES_DB_PASS: ${DB_PASS}
ports:
- 8080:8090
restart: on-failure
volumes:
- .:/app
depends_on:
postgres_db:
condition: service_healthy
networks:
- network
healthcheck:
test: ["CMD-SHELL", "sh -c 'curl -sSf http://localhost:8090/ping/v1 || exit 1'"]
interval: 5s
timeout: 10s
retries: 5
migrations:
image: alpine:latest
build:
context: .
dockerfile: Dockerfile_migrations
container_name: migrations
depends_on:
app:
condition: service_healthy
networks:
- network
postgres_db:
image: postgres:latest
container_name: postgres
environment:
POSTGRES_DB: ${DB_NAME}
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASS}
ports:
- 1234:5432
volumes:
- database:/var/lib/postgresql/data
networks:
- network
healthcheck:
test: ["CMD-SHELL", "sh -c 'pg_isready -U \"$DB_USER\" -d \"$DB_NAME\"'"]
interval: 30s
timeout: 10s
retries: 5
volumes:
database:
networks:
network:
driver: bridge