-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make $PGPORT
work in docker/postgis
image
#403
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PostGIS initialization could not be completed if `$PGPORT` was not the default 5432. for example, when using `PGPORT=54321`, the initialization is incomplete: ``` postgres_1 | /usr/local/bin/docker-entrypoint.sh: sourcing /docker-entrypoint-initdb.d/10_postgis.sh postgres_1 | CREATE DATABASE postgres_1 | Loading PostGIS extensions into template_postgis postgres_1 | CREATE EXTENSION postgres_1 | CREATE EXTENSION postgres_1 | CREATE EXTENSION postgres_1 | CREATE EXTENSION postgres_1 | Loading PostGIS extensions into openmaptiles postgres_1 | CREATE EXTENSION postgres_1 | CREATE EXTENSION postgres_1 | CREATE EXTENSION postgres_1 | CREATE EXTENSION postgres_1 | postgres_1 | /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/20_omt_postgis.sh postgres_1 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ postgres_1 | Loading OMT postgis extensions postgres_1 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ postgres_1 | Loading extensions into template_postgis postgres_1 | psql: connection to server at "postgres" (172.28.0.2), port 54321 failed: Connection refused postgres_1 | Is the server running on that host and accepting TCP/IP connections? ``` where `20_omt_postgis.sh` is a copy of `docker/postgis/initdb-postgis.sh` To make `20_omt_postgis.sh` work like `10_postgis.sh` does: 1. The execute bits were removed and the script is now sourced by the parent script `/usr/local/bin/docker-entrypoint.sh`. 2. `"${psql[@]}"` is used rather than `psql`. The result is proper initialization: ``` postgres_1 | /usr/local/bin/docker-entrypoint.sh: sourcing /docker-entrypoint-initdb.d/10_postgis.sh postgres_1 | CREATE DATABASE postgres_1 | Loading PostGIS extensions into template_postgis postgres_1 | CREATE EXTENSION postgres_1 | CREATE EXTENSION postgres_1 | CREATE EXTENSION postgres_1 | CREATE EXTENSION postgres_1 | Loading PostGIS extensions into openmaptiles postgres_1 | CREATE EXTENSION postgres_1 | CREATE EXTENSION postgres_1 | CREATE EXTENSION postgres_1 | CREATE EXTENSION postgres_1 | postgres_1 | /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/20_omt_postgis.sh postgres_1 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ postgres_1 | Loading OMT postgis extensions postgres_1 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ postgres_1 | Loading extensions into template_postgis postgres_1 | DROP EXTENSION postgres_1 | DROP EXTENSION postgres_1 | NOTICE: extension "postgis" already exists, skipping postgres_1 | CREATE EXTENSION postgres_1 | NOTICE: extension "fuzzystrmatch" already exists, skipping postgres_1 | CREATE EXTENSION postgres_1 | CREATE EXTENSION postgres_1 | CREATE EXTENSION postgres_1 | CREATE EXTENSION postgres_1 | CREATE EXTENSION postgres_1 | Loading extensions into openmaptiles postgres_1 | DROP EXTENSION postgres_1 | DROP EXTENSION postgres_1 | NOTICE: extension "postgis" already exists, skipping postgres_1 | CREATE EXTENSION postgres_1 | NOTICE: extension "fuzzystrmatch" already exists, skipping postgres_1 | CREATE EXTENSION postgres_1 | CREATE EXTENSION postgres_1 | CREATE EXTENSION postgres_1 | CREATE EXTENSION postgres_1 | CREATE EXTENSION ```
Thanks a lot. I assumed that for OMT there will be PR for adding something like |
TomPohys
approved these changes
Feb 22, 2022
I think so too. Something like
|
zstadler
added a commit
to zstadler/openmaptiles
that referenced
this pull request
Feb 24, 2022
- Allow use of environment variables in addition to .env - Remove .env-postgres and the need to synchronize it with .env Resolves openmaptiles#1354 Related to openmaptiles/openmaptiles-tools#403
TomPohys
pushed a commit
to openmaptiles/openmaptiles
that referenced
this pull request
Apr 19, 2022
- Allow use of environment variables in addition to .env - Remove .env-postgres and the need to synchronize it with .env Resolves #1354 Related to openmaptiles/openmaptiles-tools#403
francois2metz
pushed a commit
to indoorequal/openmaptiles-tools
that referenced
this pull request
Mar 17, 2023
Related to openmaptiles/openmaptiles#1354 PostGIS initialization could not be completed if `$PGPORT` was not the default 5432. where `20_omt_postgis.sh` is a copy of `docker/postgis/initdb-postgis.sh` To make `20_omt_postgis.sh` work like `10_postgis.sh` does: 1. The execute bits were removed and the script is now sourced by the parent script `/usr/local/bin/docker-entrypoint.sh`. 2. `"${psql[@]}"` is used rather than `psql`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to openmaptiles/openmaptiles#1354
PostGIS initialization could not be completed if
$PGPORT
was not the default 5432.For example, when using
PGPORT=54321
, the initialization is incomplete:where
20_omt_postgis.sh
is a copy ofdocker/postgis/initdb-postgis.sh
To make
20_omt_postgis.sh
work like10_postgis.sh
does:parent script
/usr/local/bin/docker-entrypoint.sh
."${psql[@]}"
is used rather thanpsql
.The result is a complete initialization: