diff --git a/.travis.yml b/.travis.yml index 59acde1..c072dd1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,8 +11,8 @@ before_script: script: - docker build --pull --cache-from overv/openstreetmap-tile-server --tag overv/openstreetmap-tile-server . - docker volume create openstreetmap-data -- docker run --rm -v openstreetmap-data:/var/lib/postgresql/12/main overv/openstreetmap-tile-server import -- docker run --rm -v openstreetmap-data:/var/lib/postgresql/12/main -p 8080:80 -d overv/openstreetmap-tile-server run +- docker run --rm -v openstreetmap-data:/var/lib/postgresql/14/main overv/openstreetmap-tile-server import +- docker run --rm -v openstreetmap-data:/var/lib/postgresql/14/main -p 8080:80 -d overv/openstreetmap-tile-server run - sleep 30 - make DOCKER_IMAGE=overv/openstreetmap-tile-server stop after_script: diff --git a/Dockerfile b/Dockerfile index b437be5..478afd9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,27 +6,32 @@ RUN apt-get update \ git-core \ checkinstall \ g++ \ + gnupg2 \ make \ tar \ wget \ - ca-certificates + ca-certificates \ +&& apt-get update ########################################################################################################### FROM compiler-common AS compiler-postgis -RUN apt-get install -y --no-install-recommends \ - postgresql-server-dev-12 \ +RUN echo "deb http://apt.postgresql.org/pub/repos/apt focal-pgdg main" > /etc/apt/sources.list.d/pgdg.list \ +&& wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ +&& apt-get update \ +&& apt-get install -y --no-install-recommends \ + postgresql-server-dev-14 \ libxml2-dev \ libgeos-dev \ - libproj-dev -RUN wget https://download.osgeo.org/postgis/source/postgis-3.1.1.tar.gz -O postgis.tar.gz \ + libproj-dev \ +&& wget https://download.osgeo.org/postgis/source/postgis-3.2.1.tar.gz -O postgis.tar.gz \ && mkdir -p postgis_src \ && tar -xvzf postgis.tar.gz --strip 1 -C postgis_src \ && rm postgis.tar.gz \ && cd postgis_src \ && ./configure --without-protobuf --without-raster \ && make -j $(nproc) \ -&& checkinstall --pkgversion="3.1.1" --install=no --default make install +&& checkinstall --pkgversion="3.2.1" --install=no --default make install ########################################################################################################### @@ -78,10 +83,10 @@ FROM compiler-common AS compiler-stylesheet RUN apt-get install -y --no-install-recommends \ npm RUN cd ~ \ -&& git clone --single-branch --branch v5.3.1 https://github.com/gravitystorm/openstreetmap-carto.git --depth 1 \ +&& git clone --single-branch --branch v5.4.0 https://github.com/gravitystorm/openstreetmap-carto.git --depth 1 \ && cd openstreetmap-carto \ && sed -ie 's#https:\/\/naciscdn.org\/naturalearth\/110m\/cultural\/ne_110m_admin_0_boundary_lines_land.zip#https:\/\/naturalearth.s3.amazonaws.com\/110m_cultural\/ne_110m_admin_0_boundary_lines_land.zip#g' external-data.yml \ -&& npm install -g carto@0.18.2 \ +&& npm install -g carto@1.2.0 \ && carto project.mml > mapnik.xml ########################################################################################################### @@ -114,13 +119,13 @@ RUN apt-get update \ fonts-noto-cjk \ fonts-noto-hinted \ fonts-noto-unhinted \ + gnupg2 \ gdal-bin \ liblua5.3-dev \ lua5.3 \ mapnik-utils \ osmium-tool \ osmosis \ - postgresql-12 \ python-is-python3 \ python3-mapnik \ python3-lxml \ @@ -130,6 +135,10 @@ RUN apt-get update \ sudo \ ttf-unifont \ wget \ +&& echo "deb http://apt.postgresql.org/pub/repos/apt focal-pgdg main" > /etc/apt/sources.list.d/pgdg.list \ +&& wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ +&& apt-get update \ +&& apt-get install -y --no-install-recommends postgresql-14 \ && apt-get clean autoclean \ && apt-get autoremove --yes \ && rm -rf /var/lib/{apt,dpkg,cache,log}/ @@ -166,20 +175,20 @@ RUN mkdir /nodes \ && chown renderer:renderer /nodes # Configure PosgtreSQL -COPY postgresql.custom.conf.tmpl /etc/postgresql/12/main/ +COPY postgresql.custom.conf.tmpl /etc/postgresql/14/main/ RUN chown -R postgres:postgres /var/lib/postgresql \ -&& chown postgres:postgres /etc/postgresql/12/main/postgresql.custom.conf.tmpl \ -&& echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/12/main/pg_hba.conf \ -&& echo "host all all ::/0 md5" >> /etc/postgresql/12/main/pg_hba.conf +&& chown postgres:postgres /etc/postgresql/14/main/postgresql.custom.conf.tmpl \ +&& echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/14/main/pg_hba.conf \ +&& echo "host all all ::/0 md5" >> /etc/postgresql/14/main/pg_hba.conf ########################################################################################################### FROM final-base AS final # Install PostGIS -COPY --from=compiler-postgis postgis_src/postgis-src_3.1.1-1_amd64.deb . -RUN dpkg -i postgis-src_3.1.1-1_amd64.deb \ -&& rm postgis-src_3.1.1-1_amd64.deb +COPY --from=compiler-postgis postgis_src/postgis-src_3.2.1-1_amd64.deb . +RUN dpkg -i postgis-src_3.2.1-1_amd64.deb \ +&& rm postgis-src_3.2.1-1_amd64.deb # Install osm2pgsql COPY --from=compiler-osm2pgsql /root/osm2pgsql/build/build_1-1_amd64.deb . diff --git a/Makefile b/Makefile index e725e62..9be0834 100644 --- a/Makefile +++ b/Makefile @@ -10,8 +10,8 @@ push: build test: build docker volume create openstreetmap-data - docker run --rm -v openstreetmap-data:/var/lib/postgresql/12/main ${DOCKER_IMAGE} import - docker run --rm -v openstreetmap-data:/var/lib/postgresql/12/main -p 8080:80 -d ${DOCKER_IMAGE} run + docker run --rm -v openstreetmap-data:/var/lib/postgresql/14/main ${DOCKER_IMAGE} import + docker run --rm -v openstreetmap-data:/var/lib/postgresql/14/main -p 8080:80 -d ${DOCKER_IMAGE} run stop: docker rm -f `docker ps | grep '${DOCKER_IMAGE}' | awk '{ print $$1 }'` || true diff --git a/README.md b/README.md index 86c3915..802eb53 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Next, download an .osm.pbf extract from geofabrik.de for the region that you're ``` docker run \ -v /absolute/path/to/luxembourg.osm.pbf:/data.osm.pbf \ - -v openstreetmap-data:/var/lib/postgresql/12/main \ + -v openstreetmap-data:/var/lib/postgresql/14/main \ overv/openstreetmap-tile-server \ import ``` @@ -35,7 +35,7 @@ docker run \ -e UPDATES=enabled \ -v /absolute/path/to/luxembourg.osm.pbf:/data.osm.pbf \ -v /absolute/path/to/luxembourg.poly:/data.poly \ - -v openstreetmap-data:/var/lib/postgresql/12/main \ + -v openstreetmap-data:/var/lib/postgresql/14/main \ overv/openstreetmap-tile-server \ import ``` @@ -50,7 +50,7 @@ It is also possible to let the container download files for you rather than moun docker run \ -e DOWNLOAD_PBF=https://download.geofabrik.de/europe/luxembourg-latest.osm.pbf \ -e DOWNLOAD_POLY=https://download.geofabrik.de/europe/luxembourg.poly \ - -v openstreetmap-data:/var/lib/postgresql/12/main \ + -v openstreetmap-data:/var/lib/postgresql/14/main \ overv/openstreetmap-tile-server \ import ``` @@ -62,7 +62,7 @@ Run the server like this: ``` docker run \ -p 8080:80 \ - -v openstreetmap-data:/var/lib/postgresql/12/main \ + -v openstreetmap-data:/var/lib/postgresql/14/main \ -d overv/openstreetmap-tile-server \ run ``` @@ -81,7 +81,7 @@ Tiles that have already been rendered will be stored in `/var/lib/mod_tile`. To docker volume create openstreetmap-rendered-tiles docker run \ -p 8080:80 \ - -v openstreetmap-data:/var/lib/postgresql/12/main \ + -v openstreetmap-data:/var/lib/postgresql/14/main \ -v openstreetmap-rendered-tiles:/var/lib/mod_tile \ -d overv/openstreetmap-tile-server \ run @@ -97,7 +97,7 @@ Given that you've set up your import as described in the *Automatic updates* sec docker run \ -p 8080:80 \ -e UPDATES=enabled \ - -v openstreetmap-data:/var/lib/postgresql/12/main \ + -v openstreetmap-data:/var/lib/postgresql/14/main \ -v openstreetmap-rendered-tiles:/var/lib/mod_tile \ -d overv/openstreetmap-tile-server \ run @@ -112,7 +112,7 @@ To enable the `Access-Control-Allow-Origin` header to be able to retrieve tiles ``` docker run \ -p 8080:80 \ - -v openstreetmap-data:/var/lib/postgresql/12/main \ + -v openstreetmap-data:/var/lib/postgresql/14/main \ -e ALLOW_CORS=enabled \ -d overv/openstreetmap-tile-server \ run @@ -126,7 +126,7 @@ To connect to the PostgreSQL database inside the container, make sure to expose docker run \ -p 8080:80 \ -p 5432:5432 \ - -v openstreetmap-data:/var/lib/postgresql/12/main \ + -v openstreetmap-data:/var/lib/postgresql/14/main \ -d overv/openstreetmap-tile-server \ run ``` @@ -144,7 +144,7 @@ docker run \ -p 8080:80 \ -p 5432:5432 \ -e PGPASSWORD=secret \ - -v openstreetmap-data:/var/lib/postgresql/12/main \ + -v openstreetmap-data:/var/lib/postgresql/14/main \ -d overv/openstreetmap-tile-server \ run ``` @@ -160,7 +160,7 @@ The import and tile serving processes use 4 threads by default, but this number docker run \ -p 8080:80 \ -e THREADS=24 \ - -v openstreetmap-data:/var/lib/postgresql/12/main \ + -v openstreetmap-data:/var/lib/postgresql/14/main \ -d overv/openstreetmap-tile-server \ run ``` @@ -172,7 +172,7 @@ The import and tile serving processes use 800 MB RAM cache by default, but this docker run \ -p 8080:80 \ -e "OSM2PGSQL_EXTRA_ARGS=-C 4096" \ - -v openstreetmap-data:/var/lib/postgresql/12/main \ + -v openstreetmap-data:/var/lib/postgresql/14/main \ -d overv/openstreetmap-tile-server \ run ``` @@ -184,7 +184,7 @@ The database use the autovacuum feature by default. This behavior can be changed docker run \ -p 8080:80 \ -e AUTOVACUUM=off \ - -v openstreetmap-data:/var/lib/postgresql/12/main \ + -v openstreetmap-data:/var/lib/postgresql/14/main \ -d overv/openstreetmap-tile-server \ run ``` @@ -197,7 +197,7 @@ If you are planning to import the entire planet or you are running into memory e docker run \ -v /absolute/path/to/luxembourg.osm.pbf:/data.osm.pbf \ -v openstreetmap-nodes:/nodes \ - -v openstreetmap-data:/var/lib/postgresql/12/main \ + -v openstreetmap-data:/var/lib/postgresql/14/main \ -e "OSM2PGSQL_EXTRA_ARGS=--flat-nodes /nodes/flat_nodes.bin" \ overv/openstreetmap-tile-server \ import @@ -222,7 +222,7 @@ To raise it use `--shm-size` parameter. For example: ``` docker run \ -p 8080:80 \ - -v openstreetmap-data:/var/lib/postgresql/12/main \ + -v openstreetmap-data:/var/lib/postgresql/14/main \ --shm-size="192m" \ -d overv/openstreetmap-tile-server \ run diff --git a/docker-compose.yml b/docker-compose.yml index 9aaa6c2..51b31c9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,7 @@ services: map: image: overv/openstreetmap-tile-server volumes: - - openstreetmap-data:/var/lib/postgresql/12/main + - openstreetmap-data:/var/lib/postgresql/14/main ports: - "8080:80" command: "run" diff --git a/leaflet-demo.html b/leaflet-demo.html index 82d09a8..d354dc0 100644 --- a/leaflet-demo.html +++ b/leaflet-demo.html @@ -6,8 +6,8 @@ - - + +