kopia lustrzana https://github.com/kartoza/docker-postgis
rodzic
6eb1043519
commit
b70664d906
|
@ -7,6 +7,24 @@ volumes:
|
||||||
recreate-pg-data-dir:
|
recreate-pg-data-dir:
|
||||||
init-waldir:
|
init-waldir:
|
||||||
services:
|
services:
|
||||||
|
pg-local:
|
||||||
|
image: 'kartoza/postgis:${TAG:-manual-build}'
|
||||||
|
volumes:
|
||||||
|
# By default persisted volumes should be in /var/lib/postgresql
|
||||||
|
- ./default-pg-data-dir:/var/lib/postgresql
|
||||||
|
- ./tests:/tests
|
||||||
|
- ../utils:/lib/utils
|
||||||
|
environment:
|
||||||
|
# Default usage, no datadir location defined
|
||||||
|
TEST_CLASS: TestDefault
|
||||||
|
POSTGRES_PASS: 'docker'
|
||||||
|
RUN_AS_ROOT: false
|
||||||
|
healthcheck:
|
||||||
|
interval: 60s
|
||||||
|
timeout: 30s
|
||||||
|
retries: 3
|
||||||
|
test: "PGPASSWORD=docker pg_isready -h 127.0.0.1 -U docker -d gis"
|
||||||
|
|
||||||
pg-default:
|
pg-default:
|
||||||
image: 'kartoza/postgis:${TAG:-manual-build}'
|
image: 'kartoza/postgis:${TAG:-manual-build}'
|
||||||
volumes:
|
volumes:
|
||||||
|
@ -23,7 +41,7 @@ services:
|
||||||
interval: 60s
|
interval: 60s
|
||||||
timeout: 30s
|
timeout: 30s
|
||||||
retries: 3
|
retries: 3
|
||||||
test: "pg_isready"
|
test: "PGPASSWORD=docker pg_isready -h 127.0.0.1 -U docker -d gis"
|
||||||
|
|
||||||
pg-new:
|
pg-new:
|
||||||
image: 'kartoza/postgis:${TAG:-manual-build}'
|
image: 'kartoza/postgis:${TAG:-manual-build}'
|
||||||
|
@ -42,7 +60,7 @@ services:
|
||||||
interval: 60s
|
interval: 60s
|
||||||
timeout: 30s
|
timeout: 30s
|
||||||
retries: 3
|
retries: 3
|
||||||
test: "pg_isready"
|
test: "PGPASSWORD=docker pg_isready -h 127.0.0.1 -U docker -d gis"
|
||||||
|
|
||||||
pg-recreate:
|
pg-recreate:
|
||||||
image: 'kartoza/postgis:${TAG:-manual-build}'
|
image: 'kartoza/postgis:${TAG:-manual-build}'
|
||||||
|
@ -63,7 +81,7 @@ services:
|
||||||
interval: 60s
|
interval: 60s
|
||||||
timeout: 30s
|
timeout: 30s
|
||||||
retries: 3
|
retries: 3
|
||||||
test: "pg_isready"
|
test: "PGPASSWORD=docker pg_isready -h 127.0.0.1 -U docker -d gis"
|
||||||
|
|
||||||
pg-custom-waldir-wrong:
|
pg-custom-waldir-wrong:
|
||||||
image: 'kartoza/postgis:${TAG:-manual-build}'
|
image: 'kartoza/postgis:${TAG:-manual-build}'
|
||||||
|
@ -84,7 +102,7 @@ services:
|
||||||
interval: 60s
|
interval: 60s
|
||||||
timeout: 30s
|
timeout: 30s
|
||||||
retries: 3
|
retries: 3
|
||||||
test: "pg_isready"
|
test: "PGPASSWORD=docker pg_isready -h 127.0.0.1 -U docker -d gis"
|
||||||
|
|
||||||
pg-custom-waldir-correct:
|
pg-custom-waldir-correct:
|
||||||
image: 'kartoza/postgis:${TAG:-manual-build}'
|
image: 'kartoza/postgis:${TAG:-manual-build}'
|
||||||
|
@ -105,7 +123,7 @@ services:
|
||||||
interval: 60s
|
interval: 60s
|
||||||
timeout: 30s
|
timeout: 30s
|
||||||
retries: 3
|
retries: 3
|
||||||
test: "pg_isready"
|
test: "PGPASSWORD=docker pg_isready -h 127.0.0.1 -U docker -d gis"
|
||||||
|
|
||||||
pg-custom-waldir-not-match-1:
|
pg-custom-waldir-not-match-1:
|
||||||
image: 'kartoza/postgis:${TAG:-manual-build}'
|
image: 'kartoza/postgis:${TAG:-manual-build}'
|
||||||
|
@ -126,7 +144,7 @@ services:
|
||||||
interval: 60s
|
interval: 60s
|
||||||
timeout: 30s
|
timeout: 30s
|
||||||
retries: 3
|
retries: 3
|
||||||
test: "pg_isready"
|
test: "PGPASSWORD=docker pg_isready -h 127.0.0.1 -U docker -d gis"
|
||||||
|
|
||||||
pg-custom-waldir-not-match-2:
|
pg-custom-waldir-not-match-2:
|
||||||
image: 'kartoza/postgis:${TAG:-manual-build}'
|
image: 'kartoza/postgis:${TAG:-manual-build}'
|
||||||
|
@ -147,5 +165,5 @@ services:
|
||||||
interval: 60s
|
interval: 60s
|
||||||
timeout: 30s
|
timeout: 30s
|
||||||
retries: 3
|
retries: 3
|
||||||
test: "pg_isready"
|
test: "PGPASSWORD=docker pg_isready -h 127.0.0.1 -U docker -d gis"
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,23 @@ volumes:
|
||||||
recreate-pg-data-dir:
|
recreate-pg-data-dir:
|
||||||
init-waldir:
|
init-waldir:
|
||||||
services:
|
services:
|
||||||
|
pg-local:
|
||||||
|
image: 'kartoza/postgis:${TAG:-manual-build}'
|
||||||
|
volumes:
|
||||||
|
# By default persisted volumes should be in /var/lib/postgresql
|
||||||
|
- ./local-pg-data-dir:/var/lib/postgresql
|
||||||
|
- ./tests:/tests
|
||||||
|
- ../utils:/lib/utils
|
||||||
|
environment:
|
||||||
|
# Default usage, no datadir location defined
|
||||||
|
TEST_CLASS: TestDefault
|
||||||
|
POSTGRES_PASS: 'docker'
|
||||||
|
healthcheck:
|
||||||
|
interval: 60s
|
||||||
|
timeout: 30s
|
||||||
|
retries: 3
|
||||||
|
test: "PGPASSWORD=docker pg_isready -h 127.0.0.1 -U docker -d gis"
|
||||||
|
|
||||||
pg-default:
|
pg-default:
|
||||||
image: 'kartoza/postgis:${TAG:-manual-build}'
|
image: 'kartoza/postgis:${TAG:-manual-build}'
|
||||||
volumes:
|
volumes:
|
||||||
|
@ -22,7 +39,7 @@ services:
|
||||||
interval: 60s
|
interval: 60s
|
||||||
timeout: 30s
|
timeout: 30s
|
||||||
retries: 3
|
retries: 3
|
||||||
test: "pg_isready"
|
test: "PGPASSWORD=docker pg_isready -h 127.0.0.1 -U docker -d gis"
|
||||||
|
|
||||||
pg-new:
|
pg-new:
|
||||||
image: 'kartoza/postgis:${TAG:-manual-build}'
|
image: 'kartoza/postgis:${TAG:-manual-build}'
|
||||||
|
@ -40,7 +57,7 @@ services:
|
||||||
interval: 60s
|
interval: 60s
|
||||||
timeout: 30s
|
timeout: 30s
|
||||||
retries: 3
|
retries: 3
|
||||||
test: "pg_isready"
|
test: "PGPASSWORD=docker pg_isready -h 127.0.0.1 -U docker -d gis"
|
||||||
|
|
||||||
pg-recreate:
|
pg-recreate:
|
||||||
image: 'kartoza/postgis:${TAG:-manual-build}'
|
image: 'kartoza/postgis:${TAG:-manual-build}'
|
||||||
|
@ -60,7 +77,7 @@ services:
|
||||||
interval: 60s
|
interval: 60s
|
||||||
timeout: 30s
|
timeout: 30s
|
||||||
retries: 3
|
retries: 3
|
||||||
test: "pg_isready"
|
test: "PGPASSWORD=docker pg_isready -h 127.0.0.1 -U docker -d gis"
|
||||||
|
|
||||||
pg-custom-waldir-wrong:
|
pg-custom-waldir-wrong:
|
||||||
image: 'kartoza/postgis:${TAG:-manual-build}'
|
image: 'kartoza/postgis:${TAG:-manual-build}'
|
||||||
|
@ -80,7 +97,7 @@ services:
|
||||||
interval: 60s
|
interval: 60s
|
||||||
timeout: 30s
|
timeout: 30s
|
||||||
retries: 3
|
retries: 3
|
||||||
test: "pg_isready"
|
test: "PGPASSWORD=docker pg_isready -h 127.0.0.1 -U docker -d gis"
|
||||||
|
|
||||||
pg-custom-waldir-correct:
|
pg-custom-waldir-correct:
|
||||||
image: 'kartoza/postgis:${TAG:-manual-build}'
|
image: 'kartoza/postgis:${TAG:-manual-build}'
|
||||||
|
@ -100,7 +117,7 @@ services:
|
||||||
interval: 60s
|
interval: 60s
|
||||||
timeout: 30s
|
timeout: 30s
|
||||||
retries: 3
|
retries: 3
|
||||||
test: "pg_isready"
|
test: "PGPASSWORD=docker pg_isready -h 127.0.0.1 -U docker -d gis"
|
||||||
|
|
||||||
pg-custom-waldir-not-match-1:
|
pg-custom-waldir-not-match-1:
|
||||||
image: 'kartoza/postgis:${TAG:-manual-build}'
|
image: 'kartoza/postgis:${TAG:-manual-build}'
|
||||||
|
@ -120,7 +137,7 @@ services:
|
||||||
interval: 60s
|
interval: 60s
|
||||||
timeout: 30s
|
timeout: 30s
|
||||||
retries: 3
|
retries: 3
|
||||||
test: "pg_isready"
|
test: "PGPASSWORD=docker pg_isready -h 127.0.0.1 -U docker -d gis"
|
||||||
|
|
||||||
pg-custom-waldir-not-match-2:
|
pg-custom-waldir-not-match-2:
|
||||||
image: 'kartoza/postgis:${TAG:-manual-build}'
|
image: 'kartoza/postgis:${TAG:-manual-build}'
|
||||||
|
@ -140,5 +157,5 @@ services:
|
||||||
interval: 60s
|
interval: 60s
|
||||||
timeout: 30s
|
timeout: 30s
|
||||||
retries: 3
|
retries: 3
|
||||||
test: "pg_isready"
|
test: "PGPASSWORD=docker pg_isready -h 127.0.0.1 -U docker -d gis"
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ fi
|
||||||
|
|
||||||
|
|
||||||
# Run service for root user
|
# Run service for root user
|
||||||
${VERSION} up -d pg-default pg-new pg-recreate
|
${VERSION} up -d pg-local pg-default pg-new pg-recreate
|
||||||
|
|
||||||
if [[ -n "${PRINT_TEST_LOGS}" ]]; then
|
if [[ -n "${PRINT_TEST_LOGS}" ]]; then
|
||||||
${VERSION} logs -f &
|
${VERSION} logs -f &
|
||||||
|
@ -21,7 +21,7 @@ fi
|
||||||
|
|
||||||
sleep 30
|
sleep 30
|
||||||
|
|
||||||
services=("pg-default" "pg-new" "pg-recreate")
|
services=("pg-local" "pg-default" "pg-new" "pg-recreate")
|
||||||
|
|
||||||
for service in "${services[@]}"; do
|
for service in "${services[@]}"; do
|
||||||
|
|
||||||
|
@ -40,9 +40,11 @@ bash ./test_custom_waldir.sh
|
||||||
|
|
||||||
${VERSION} down -v
|
${VERSION} down -v
|
||||||
|
|
||||||
# Run service for none root user
|
|
||||||
|
|
||||||
${VERSION} -f docker-compose-gs.yml up -d pg-default pg-new pg-recreate
|
# Run service for none root user
|
||||||
|
mkdir default-pg-data-dir
|
||||||
|
|
||||||
|
${VERSION} -f docker-compose-gs.yml up -d pg-local pg-default pg-new pg-recreate
|
||||||
|
|
||||||
if [[ -n "${PRINT_TEST_LOGS}" ]]; then
|
if [[ -n "${PRINT_TEST_LOGS}" ]]; then
|
||||||
${VERSION} -f docker-compose-gs.yml logs -f &
|
${VERSION} -f docker-compose-gs.yml logs -f &
|
||||||
|
@ -50,7 +52,7 @@ fi
|
||||||
|
|
||||||
sleep 30
|
sleep 30
|
||||||
|
|
||||||
services=("pg-default" "pg-new" "pg-recreate")
|
services=("pg-local" "pg-default" "pg-new" "pg-recreate")
|
||||||
|
|
||||||
for service in "${services[@]}"; do
|
for service in "${services[@]}"; do
|
||||||
|
|
||||||
|
|
|
@ -23,11 +23,11 @@ fi
|
||||||
# Try to make sure that container recreation is successful
|
# Try to make sure that container recreation is successful
|
||||||
echo "### Checking Container Recreation"
|
echo "### Checking Container Recreation"
|
||||||
${VERSION} down
|
${VERSION} down
|
||||||
${VERSION} up -d pg-default pg-new pg-recreate
|
${VERSION} up -d pg-local pg-default pg-new pg-recreate
|
||||||
|
|
||||||
sleep 60
|
sleep 60
|
||||||
|
|
||||||
services=("pg-default" "pg-new" "pg-recreate")
|
services=("pg-local" "pg-default" "pg-new" "pg-recreate")
|
||||||
|
|
||||||
for service in "${services[@]}"; do
|
for service in "${services[@]}"; do
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
create_dir "${WAL_ARCHIVE}"
|
create_dir "${WAL_ARCHIVE}"
|
||||||
non_root_permission postgres postgres
|
|
||||||
|
|
||||||
# test if DATADIR has content
|
# test if DATADIR has content
|
||||||
# Do initialization if DATADIR directory is empty, or RECREATE_DATADIR is true
|
# Do initialization if DATADIR directory is empty, or RECREATE_DATADIR is true
|
||||||
|
@ -74,6 +74,7 @@ EOF
|
||||||
fi
|
fi
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
|
non_root_permission postgres postgres
|
||||||
# Set proper permissions
|
# Set proper permissions
|
||||||
# needs to be done as root:
|
# needs to be done as root:
|
||||||
chown -R postgres:postgres ${DATADIR} ${WAL_ARCHIVE}
|
chown -R postgres:postgres ${DATADIR} ${WAL_ARCHIVE}
|
||||||
|
|
Ładowanie…
Reference in New Issue