-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
56 lines (52 loc) · 1.59 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
---
version: "3.8"
services:
postgres:
image: postgres:15.3-alpine3.18
command: postgres -c 'max_connections=1000'
environment:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_MULTIPLE_DATABASES: reference, transaction
healthcheck:
test: pg_isready --username "postgres" --dbname "reference"
interval: 1s
retries: 5
timeout: 5s
ports:
- 32260:5432
volumes:
- ./docker-multiple-databases.sh:/docker-entrypoint-initdb.d/docker-multiple-databases.sh:ro
tmpfs:
- /var/lib/postgresql/data:rw # Necessary to speed up integration tests.
migrate-reference:
image: migrate/migrate:v4.16.2
command: >
-source 'file:///migrations'
-database 'postgresql://postgres:postgres@postgres:5432/reference?sslmode=disable' up
depends_on:
postgres:
condition: service_healthy
volumes:
- ./migrations:/migrations:ro
migrate-transaction:
image: migrate/migrate:v4.16.2
command: >
-source 'file:///migrations'
-database 'postgresql://postgres:postgres@postgres:5432/transaction?sslmode=disable' up
depends_on:
postgres:
condition: service_healthy
volumes:
- ./migrations:/migrations:ro
migrate:
image: postgres:15.3-alpine3.18
command: echo 'All migrations have been successfully applied!'
depends_on:
postgres:
condition: service_healthy
migrate-reference:
condition: service_completed_successfully
migrate-transaction:
condition: service_completed_successfully