-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
74 lines (58 loc) · 1.17 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
version: "3"
services:
postgres:
image: "postgres:16.1-alpine"
container_name: "duorent-db"
restart: always
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
ports:
- "${POSTGRES_PORT}:5432"
volumes:
- "./data/postgres:/data/postgres"
networks:
duorent:
aliases:
- ${POSTGRES_HOST}
healthcheck:
test: [
"CMD-SHELL",
"pg_isready",
"-U",
"${POSTGRES_USER}",
"-d",
"${POSTGRES_DB}"
]
interval: 15s
timeout: 15s
retries: 3
postgres-migrate:
image: migrate/migrate:v4.15.2
container_name: duorent-pg-migrate
restart: on-failure
volumes:
- ./migrations:/migrations
networks:
- ${POSTGRES_HOST}
profiles:
- tools
entrypoint: [
"migrate",
"-database",
"${POSTGRES_CONN_STRING}",
"-path",
"/migrations"
]
command: [ "up" ]
depends_on:
postgres:
condition: service_healthy
links:
- postgres
volumes:
postgres:
networks:
duorent:
driver: bridge