-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
59 lines (55 loc) · 1.39 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
version: '3.4'
services:
pg-fort:
image: pg-fort
build:
dockerfile: Dockerfile
ports:
- 8890:8890
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
depends_on:
postgres:
condition: service_healthy
postgres-migrate:
condition: service_completed_successfully
working_dir: /usr/local/pg-fort
command: 8890 postgres 5432
postgres-migrate:
build:
context: schema
dockerfile: Dockerfile
target: build
volumes:
- ./schema:/schema
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
command: sql-migrate up --config=schema/dbconfig.yml -env=development
depends_on:
postgres:
condition: service_healthy
postgres:
image: postgres
volumes:
- test-postgres-db:/var/lib/postgres/data
ports:
- 5432:5432
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"
]
interval: 10s
timeout: 10s
retries: 50
volumes:
test-postgres-db: