Skip to content

Commit

Permalink
Merge pull request #27 from auro/feature/thread-env-var
Browse files Browse the repository at this point in the history
Allow to define threads on env variable
  • Loading branch information
peter-evans authored Apr 22, 2020
2 parents 47fb4d5 + 076d41c commit 27f1fc1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ Before deploying, edit the `env` section of both the canary deployment and stabl
- `NOMINATIM_SA_KEY_PATH` - Path to the JSON service account key. This needs to match the `mountPath` of the volume mounted secret.
- `NOMINATIM_PROJECT_ID` - Google Cloud project ID.
- `NOMINATIM_GS_BUCKET` - Google Storage bucket.
- `NOMINATIM_PG_THREADS` - Number of threads available for PostgreSQL. Defaults to 2.

## License

Expand Down
4 changes: 2 additions & 2 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ NOMINATIM_POSTGRESQL_DATA_PATH=${NOMINATIM_POSTGRESQL_DATA_PATH:="/var/lib/postg
NOMINATIM_SA_KEY_PATH=${NOMINATIM_SA_KEY_PATH:=""}
NOMINATIM_PROJECT_ID=${NOMINATIM_PROJECT_ID:=""}
NOMINATIM_GS_BUCKET=${NOMINATIM_GS_BUCKET:=""}

NOMINATIM_PG_THREADS=${NOMINATIM_PG_THREADS:=2}

if [ "$NOMINATIM_MODE" == "CREATE" ]; then

Expand All @@ -31,7 +31,7 @@ if [ "$NOMINATIM_MODE" == "CREATE" ]; then
sudo -u postgres psql postgres -tAc "SELECT 1 FROM pg_roles WHERE rolname='www-data'" | grep -q 1 || sudo -u postgres createuser -SDR www-data
sudo -u postgres psql postgres -c "DROP DATABASE IF EXISTS nominatim"
useradd -m -p password1234 nominatim
sudo -u nominatim /srv/nominatim/build/utils/setup.php --osm-file $NOMINATIM_DATA_PATH/$NOMINATIM_DATA_LABEL.osm.pbf --all --threads 2
sudo -u nominatim /srv/nominatim/build/utils/setup.php --osm-file $NOMINATIM_DATA_PATH/$NOMINATIM_DATA_LABEL.osm.pbf --all --threads $NOMINATIM_PG_THREADS

if [ ! -z "$NOMINATIM_SA_KEY_PATH" ] && [ ! -z "$NOMINATIM_PROJECT_ID" ] && [ ! -z "$NOMINATIM_GS_BUCKET" ]; then

Expand Down

0 comments on commit 27f1fc1

Please sign in to comment.