-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdocker-compose-postgres.yml
45 lines (41 loc) · 1.02 KB
/
docker-compose-postgres.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
version: "3.6"
services:
postgres:
container_name: ${POSTGRES_HOST}
image: postgres:11-alpine
networks:
- atlas-test-net
volumes:
- pgdata:/var/lib/postgresql/data
ports:
- "5432:5432"
command: -c max_wal_size=3GB
environment:
- POSTGRES_PASSWORD
- POSTGRES_USER
- POSTGRES_DB
flyway:
image: flyway/flyway
networks:
- atlas-test-net
depends_on:
- postgres
volumes:
- ../schemas/flyway/${PROJECT_NAME}:/flyway/sql
command: [
"-X",
"-url=jdbc:postgresql://${POSTGRES_HOST}:5432/${POSTGRES_DB}",
"-schemas=${POSTGRES_USER}",
"-user=${POSTGRES_USER}",
"-password=${POSTGRES_PASSWORD}",
"-target=${SCHEMA_VERSION}",
"-connectRetries=60",
"migrate"
]
volumes:
pgdata:
# Not strictly necessary to error out, but it avoids creating an empty `scxa_postgres-11-pgdata-` volume
name: ${PROJECT_NAME:?err}_pgdata-${SCHEMA_VERSION:?err}
networks:
atlas-test-net:
name: atlas-test-net