added bootstrap buildings
This commit is contained in:
@@ -23,7 +23,7 @@ DB_NAME=${POSTGRES_DB:-radio}
|
||||
DB_USER=${POSTGRES_USER:-radio}
|
||||
DB_PASSWORD=${DB_PASSWORD:-radio}
|
||||
POSTGIS_SERVICE=${POSTGIS_SERVICE:-postgis}
|
||||
OSM2PGSQL_IMAGE=${OSM2PGSQL_IMAGE:-osm2pgsql/osm2pgsql:latest}
|
||||
OSM2PGSQL_IMAGE=${OSM2PGSQL_IMAGE:-radio-osm2pgsql:latest}
|
||||
|
||||
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
||||
REPO_DIR=$(CDPATH= cd -- "$SCRIPT_DIR/.." && pwd)
|
||||
@@ -40,6 +40,14 @@ NETWORK=$(docker inspect "$POSTGIS_CONTAINER" \
|
||||
--format '{{range $name, $_ := .NetworkSettings.Networks}}{{println $name}}{{end}}' \
|
||||
| head -n 1)
|
||||
|
||||
if ! docker image inspect "$OSM2PGSQL_IMAGE" >/dev/null 2>&1; then
|
||||
echo "Build local osm2pgsql image: $OSM2PGSQL_IMAGE"
|
||||
docker build \
|
||||
-t "$OSM2PGSQL_IMAGE" \
|
||||
-f "$SCRIPT_DIR/Dockerfile.osm2pgsql" \
|
||||
"$SCRIPT_DIR"
|
||||
fi
|
||||
|
||||
echo "Ensure PostGIS extension exists"
|
||||
docker compose exec -T "$POSTGIS_SERVICE" psql -U "$DB_USER" -d "$DB_NAME" \
|
||||
< "$REPO_DIR/db/init/01_postgis.sql"
|
||||
|
||||
Reference in New Issue
Block a user