From 879e5f25aba834e655e0c2bc587426e78f89aca3 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Sat, 21 Dec 2019 21:57:57 +0100 Subject: [PATCH 01/30] Create .travis.yml --- .travis.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..5afdaed --- /dev/null +++ b/.travis.yml @@ -0,0 +1,15 @@ +sudo: required +services: +- docker +before_install: +- echo "Before install" +before_script: +- echo "Before script" +script: +- docker build -t osm . +after_script: +- docker images +after_success: +- if [[ "$TRAVIS_BRANCH" == "master" ]]; then echo "One can push to image dockerhub" ; fi +notifications: + email: true From 92708df534135897d9c25e87e98a649722ea428f Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Sat, 21 Dec 2019 22:19:12 +0100 Subject: [PATCH 02/30] :hammer: Reorder ubuntu packages --- Dockerfile | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index a2b0f56..18a7b1e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,14 +22,14 @@ RUN apt-get update \ autoconf \ build-essential \ bzip2 \ + clang \ cmake \ + cron \ fonts-noto-cjk \ fonts-noto-hinted \ fonts-noto-unhinted \ - clang \ gcc \ gdal-bin \ - make \ git-core \ libagg-dev \ libboost-all-dev \ @@ -56,22 +56,23 @@ RUN apt-get update \ mapnik-utils \ nodejs \ npm \ + osmium-tool \ + osmosis \ postgis \ postgresql-12 \ - postgresql-server-dev-12 \ postgresql-contrib-12 \ + postgresql-server-dev-12 \ protobuf-c-compiler \ python-mapnik \ + python3-lxml \ + python3-psycopg2 \ + python3-shapely \ sudo \ tar \ ttf-unifont \ unzip \ wget \ zlib1g-dev \ - osmosis \ - osmium-tool \ - cron \ - python3-psycopg2 python3-shapely python3-lxml \ && apt-get clean autoclean \ && apt-get autoremove --yes \ && rm -rf /var/lib/{apt,dpkg,cache,log}/ From c8a79a19e4eecb0329becfe24e022d7b252d5024 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Sat, 21 Dec 2019 22:20:35 +0100 Subject: [PATCH 03/30] :hammer: Refactored PostGIS install --- Dockerfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 18a7b1e..a8cf91a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -78,9 +78,13 @@ RUN apt-get update \ && rm -rf /var/lib/{apt,dpkg,cache,log}/ # Set up PostGIS -RUN wget http://download.osgeo.org/postgis/source/postgis-3.0.0rc2.tar.gz -RUN tar -xvzf postgis-3.0.0rc2.tar.gz -RUN cd postgis-3.0.0rc2 && ./configure && make && make install +RUN wget http://download.osgeo.org/postgis/source/postgis-3.0.0rc2.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 && make && make install \ + && cd .. && rm -rf postgis_src # Set up renderer user RUN adduser --disabled-password --gecos "" renderer From 8bac516eb14d6c5045cd32f5f7c0e9fef570b23f Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Sat, 21 Dec 2019 22:25:04 +0100 Subject: [PATCH 04/30] :hammer: Refactored osm2pgsql install --- Dockerfile | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index a8cf91a..27e184b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -91,18 +91,18 @@ RUN adduser --disabled-password --gecos "" renderer USER renderer # Install latest osm2pgsql -RUN mkdir /home/renderer/src -WORKDIR /home/renderer/src -RUN git clone https://github.com/openstreetmap/osm2pgsql.git -WORKDIR /home/renderer/src/osm2pgsql -RUN mkdir build -WORKDIR /home/renderer/src/osm2pgsql/build -RUN cmake .. \ - && make -j $(nproc) -USER root -RUN make install -RUN mkdir /nodes \ - && chown renderer:renderer /nodes +RUN mkdir -p /home/renderer/src \ + && cd /home/renderer/src \ + && git clone https://github.com/openstreetmap/osm2pgsql.git \ + && cd /home/renderer/src/osm2pgsql \ + && mkdir build \ + && cd build \ + && cmake .. \ + && make -j $(nproc) \ + && make install \ + && mkdir /nodes \ + && chown renderer:renderer /nodes \ + && rm -rf /home/renderer/src USER renderer # Install and test Mapnik From 0527120c30903e361d3ae2f9c48bacee34abc66f Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Sat, 21 Dec 2019 22:26:30 +0100 Subject: [PATCH 05/30] :hammer: Refactored mod_tile install --- Dockerfile | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 27e184b..6bf2088 100644 --- a/Dockerfile +++ b/Dockerfile @@ -109,16 +109,17 @@ USER renderer RUN python -c 'import mapnik' # Install mod_tile and renderd -WORKDIR /home/renderer/src -RUN git clone -b switch2osm https://github.com/SomeoneElseOSM/mod_tile.git -WORKDIR /home/renderer/src/mod_tile -RUN ./autogen.sh \ - && ./configure \ - && make -j $(nproc) -USER root -RUN make -j $(nproc) install \ - && make -j $(nproc) install-mod_tile \ - && ldconfig +RUN mkdir -p /home/renderer/src \ + && git clone -b switch2osm https://github.com/SomeoneElseOSM/mod_tile.git \ + && cd mod_tile \ + && ./autogen.sh \ + && ./configure \ + && make -j $(nproc) \ + && make -j $(nproc) install \ + && make -j $(nproc) install-mod_tile \ + && ldconfig \ + && cd .. \ + && rm -rf mod_tile USER renderer # Configure stylesheet From 868d2fae0a0890b360a32f76e9c8e358dcec1735 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Sat, 21 Dec 2019 22:27:02 +0100 Subject: [PATCH 06/30] :hammer: Refactored openstreetmap-carto install --- Dockerfile | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6bf2088..3c25131 100644 --- a/Dockerfile +++ b/Dockerfile @@ -123,12 +123,11 @@ RUN mkdir -p /home/renderer/src \ USER renderer # Configure stylesheet -WORKDIR /home/renderer/src -RUN git clone https://github.com/gravitystorm/openstreetmap-carto.git \ - && git -C openstreetmap-carto checkout v4.23.0 -WORKDIR /home/renderer/src/openstreetmap-carto -USER root -RUN npm install -g carto@0.18.2 +RUN mkdir -p /home/renderer/src \ + && git clone https://github.com/gravitystorm/openstreetmap-carto.git \ + && git -C openstreetmap-carto checkout v4.23.0 \ + && openstreetmap-carto \ + && npm install -g carto@0.18.2 USER renderer RUN carto project.mml > mapnik.xml From 6de21a4595c2406cbdccada804c31eb1663bfc93 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Sat, 21 Dec 2019 22:33:56 +0100 Subject: [PATCH 07/30] :hammer: Refactored PosgtreSQL install --- Dockerfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3c25131..739b488 100644 --- a/Dockerfile +++ b/Dockerfile @@ -144,12 +144,12 @@ USER renderer # Configure Apache USER root RUN mkdir /var/lib/mod_tile \ - && chown renderer /var/lib/mod_tile \ - && mkdir /var/run/renderd \ - && chown renderer /var/run/renderd -RUN echo "LoadModule tile_module /usr/lib/apache2/modules/mod_tile.so" >> /etc/apache2/conf-available/mod_tile.conf \ - && echo "LoadModule headers_module /usr/lib/apache2/modules/mod_headers.so" >> /etc/apache2/conf-available/mod_headers.conf \ - && a2enconf mod_tile && a2enconf mod_headers + && chown renderer /var/lib/mod_tile \ + && mkdir /var/run/renderd \ + && chown renderer /var/run/renderd \ + && echo "LoadModule tile_module /usr/lib/apache2/modules/mod_tile.so" >> /etc/apache2/conf-available/mod_tile.conf \ + && echo "LoadModule headers_module /usr/lib/apache2/modules/mod_headers.so" >> /etc/apache2/conf-available/mod_headers.conf \ + && a2enconf mod_tile && a2enconf mod_headers COPY apache.conf /etc/apache2/sites-available/000-default.conf COPY leaflet-demo.html /var/www/html/index.html RUN ln -sf /dev/stdout /var/log/apache2/access.log \ From efc2cb1e2a7c44e137f0e2ac5b2aad63a3608083 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Sat, 21 Dec 2019 22:34:30 +0100 Subject: [PATCH 08/30] :hammer: Refactored PosgtreSQL install --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 739b488..079a9a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -158,9 +158,9 @@ RUN ln -sf /dev/stdout /var/log/apache2/access.log \ # Configure PosgtreSQL COPY postgresql.custom.conf.tmpl /etc/postgresql/12/main/ RUN chown -R postgres:postgres /var/lib/postgresql \ - && chown postgres:postgres /etc/postgresql/12/main/postgresql.custom.conf.tmpl -RUN 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/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 # copy update scripts COPY openstreetmap-tiles-update-expire /usr/bin/ From 69cb804609e82a38c1381af519b6010c6492be28 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Sat, 21 Dec 2019 22:37:32 +0100 Subject: [PATCH 09/30] :pencil: Typo update --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 079a9a7..45dba69 100644 --- a/Dockerfile +++ b/Dockerfile @@ -165,10 +165,10 @@ RUN chown -R postgres:postgres /var/lib/postgresql \ # copy update scripts COPY openstreetmap-tiles-update-expire /usr/bin/ RUN chmod +x /usr/bin/openstreetmap-tiles-update-expire \ - && mkdir /var/log/tiles \ - && chmod a+rw /var/log/tiles \ - && ln -s /home/renderer/src/mod_tile/osmosis-db_replag /usr/bin/osmosis-db_replag \ - && echo "* * * * * renderer openstreetmap-tiles-update-expire\n" >> /etc/crontab + && mkdir /var/log/tiles \ + && chmod a+rw /var/log/tiles \ + && ln -s /home/renderer/src/mod_tile/osmosis-db_replag /usr/bin/osmosis-db_replag \ + && echo "* * * * * renderer openstreetmap-tiles-update-expire\n" >> /etc/crontab # install trim_osc.py helper script USER renderer From fa4b0eba0bdd44cb7c1d8c099ed878bdaea50633 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Sat, 21 Dec 2019 22:37:45 +0100 Subject: [PATCH 10/30] :pencil: Typo update --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 45dba69..b5dc8fb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -173,10 +173,10 @@ RUN chmod +x /usr/bin/openstreetmap-tiles-update-expire \ # install trim_osc.py helper script USER renderer RUN cd ~/src \ - && git clone https://github.com/zverik/regional \ - && cd regional \ - && git checkout 612fe3e040d8bb70d2ab3b133f3b2cfc6c940520 \ - && chmod u+x ~/src/regional/trim_osc.py + && git clone https://github.com/zverik/regional \ + && cd regional \ + && git checkout 612fe3e040d8bb70d2ab3b133f3b2cfc6c940520 \ + && chmod u+x ~/src/regional/trim_osc.py # Start running USER root From f9f10474004afeb3ef73add7c573c0eb50f681b0 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Sat, 21 Dec 2019 22:42:40 +0100 Subject: [PATCH 11/30] :pencil: Updated .travis.yml --- .travis.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5afdaed..5045922 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ -sudo: required +os: linux +language: minimal services: - docker before_install: @@ -6,7 +7,9 @@ before_install: before_script: - echo "Before script" script: -- docker build -t osm . +- make build +- make test +- make stop after_script: - docker images after_success: From 62a972736a2c856bca087730684e1b6d1d4fb84f Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Sat, 21 Dec 2019 22:53:12 +0100 Subject: [PATCH 12/30] :hammer: Updated user command --- Dockerfile | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/Dockerfile b/Dockerfile index b5dc8fb..26cd2ff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -88,7 +88,6 @@ RUN wget http://download.osgeo.org/postgis/source/postgis-3.0.0rc2.tar.gz -O pos # Set up renderer user RUN adduser --disabled-password --gecos "" renderer -USER renderer # Install latest osm2pgsql RUN mkdir -p /home/renderer/src \ @@ -103,10 +102,6 @@ RUN mkdir -p /home/renderer/src \ && mkdir /nodes \ && chown renderer:renderer /nodes \ && rm -rf /home/renderer/src -USER renderer - -# Install and test Mapnik -RUN python -c 'import mapnik' # Install mod_tile and renderd RUN mkdir -p /home/renderer/src \ @@ -120,29 +115,21 @@ RUN mkdir -p /home/renderer/src \ && ldconfig \ && cd .. \ && rm -rf mod_tile -USER renderer # Configure stylesheet RUN mkdir -p /home/renderer/src \ && git clone https://github.com/gravitystorm/openstreetmap-carto.git \ && git -C openstreetmap-carto checkout v4.23.0 \ - && openstreetmap-carto \ - && npm install -g carto@0.18.2 -USER renderer -RUN carto project.mml > mapnik.xml - -# Load shapefiles -WORKDIR /home/renderer/src/openstreetmap-carto -RUN scripts/get-shapefiles.py + && cd openstreetmap-carto \ + && npm install -g carto@0.18.2 \ + && carto project.mml > mapnik.xml \ + && scripts/get-shapefiles.py # Configure renderd -USER root RUN sed -i 's/renderaccount/renderer/g' /usr/local/etc/renderd.conf \ - && sed -i 's/hot/tile/g' /usr/local/etc/renderd.conf -USER renderer + && sed -i 's/hot/tile/g' /usr/local/etc/renderd.conf # Configure Apache -USER root RUN mkdir /var/lib/mod_tile \ && chown renderer /var/lib/mod_tile \ && mkdir /var/run/renderd \ @@ -171,7 +158,6 @@ RUN chmod +x /usr/bin/openstreetmap-tiles-update-expire \ && echo "* * * * * renderer openstreetmap-tiles-update-expire\n" >> /etc/crontab # install trim_osc.py helper script -USER renderer RUN cd ~/src \ && git clone https://github.com/zverik/regional \ && cd regional \ @@ -179,7 +165,6 @@ RUN cd ~/src \ && chmod u+x ~/src/regional/trim_osc.py # Start running -USER root COPY run.sh / COPY indexes.sql / ENTRYPOINT ["/run.sh"] From b71e7a6aba1e1ab78796870f5abf10bcbc813c27 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Sat, 21 Dec 2019 23:09:37 +0100 Subject: [PATCH 13/30] :hammer: Refactored regional instruction --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 26cd2ff..cdaab7e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -158,11 +158,12 @@ RUN chmod +x /usr/bin/openstreetmap-tiles-update-expire \ && echo "* * * * * renderer openstreetmap-tiles-update-expire\n" >> /etc/crontab # install trim_osc.py helper script -RUN cd ~/src \ +RUN mkdir -p /home/renderer/src \ + && cd /home/renderer/src \ && git clone https://github.com/zverik/regional \ && cd regional \ && git checkout 612fe3e040d8bb70d2ab3b133f3b2cfc6c940520 \ - && chmod u+x ~/src/regional/trim_osc.py + && chmod u+x /home/renderer/src/regional/trim_osc.py # Start running COPY run.sh / From d8ccc2c02692e28357147c0a6f9707e5865946f8 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Sun, 22 Dec 2019 21:13:09 +0100 Subject: [PATCH 14/30] :wrench: Removed clang --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index cdaab7e..3e3d848 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,6 @@ RUN apt-get update \ autoconf \ build-essential \ bzip2 \ - clang \ cmake \ cron \ fonts-noto-cjk \ From e8e95c6001a7a794a7dac36d6ebed2d96536cff7 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Sun, 22 Dec 2019 21:21:56 +0100 Subject: [PATCH 15/30] :hammer: Refactored Dockerfile --- Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3e3d848..fd79bf9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -139,7 +139,7 @@ RUN mkdir /var/lib/mod_tile \ COPY apache.conf /etc/apache2/sites-available/000-default.conf COPY leaflet-demo.html /var/www/html/index.html RUN ln -sf /dev/stdout /var/log/apache2/access.log \ - && ln -sf /dev/stderr /var/log/apache2/error.log + && ln -sf /dev/stderr /var/log/apache2/error.log # Configure PosgtreSQL COPY postgresql.custom.conf.tmpl /etc/postgresql/12/main/ @@ -148,7 +148,7 @@ RUN chown -R postgres:postgres /var/lib/postgresql \ && 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 -# copy update scripts +# Copy update scripts COPY openstreetmap-tiles-update-expire /usr/bin/ RUN chmod +x /usr/bin/openstreetmap-tiles-update-expire \ && mkdir /var/log/tiles \ @@ -156,12 +156,13 @@ RUN chmod +x /usr/bin/openstreetmap-tiles-update-expire \ && ln -s /home/renderer/src/mod_tile/osmosis-db_replag /usr/bin/osmosis-db_replag \ && echo "* * * * * renderer openstreetmap-tiles-update-expire\n" >> /etc/crontab -# install trim_osc.py helper script +# Install trim_osc.py helper script RUN mkdir -p /home/renderer/src \ && cd /home/renderer/src \ && git clone https://github.com/zverik/regional \ && cd regional \ && git checkout 612fe3e040d8bb70d2ab3b133f3b2cfc6c940520 \ + && rm -rf .git \ && chmod u+x /home/renderer/src/regional/trim_osc.py # Start running From 637e821888ea1b90491d675d32433bc72bca212a Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Sun, 22 Dec 2019 21:48:33 +0100 Subject: [PATCH 16/30] :hammer: Removed .git directory --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index fd79bf9..188c9c1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -120,6 +120,7 @@ RUN mkdir -p /home/renderer/src \ && git clone https://github.com/gravitystorm/openstreetmap-carto.git \ && git -C openstreetmap-carto checkout v4.23.0 \ && cd openstreetmap-carto \ + && rm -rf .git \ && npm install -g carto@0.18.2 \ && carto project.mml > mapnik.xml \ && scripts/get-shapefiles.py From e0f7438dab1a7ed76e467b746cd955ba63f5de2b Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Sun, 22 Dec 2019 21:49:04 +0100 Subject: [PATCH 17/30] :hammer: Updated Makefile --- Makefile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 7c37786..4d055e0 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,18 @@ .PHONY: build push test +DOCKER_IMAGE=overv/openstreetmap-tile-server + build: - docker build -t overv/openstreetmap-tile-server . + docker build -t ${DOCKER_IMAGE} . push: build - docker push overv/openstreetmap-tile-server:latest + docker push ${DOCKER_IMAGE}:latest test: build docker volume create openstreetmap-data - docker run -v openstreetmap-data:/var/lib/postgresql/12/main overv/openstreetmap-tile-server import - docker run -v openstreetmap-data:/var/lib/postgresql/12/main -p 80:80 -d overv/openstreetmap-tile-server run + 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 80:80 -d ${DOCKER_IMAGE} run + +stop: + docker rm -f `docker ps | grep '${DOCKER_IMAGE}' | awk '{ print $$1 }'` || true + docker volume rm -f openstreetmap-data From bae840f2400e60f1f138cb81b76cb284ac346714 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Sun, 22 Dec 2019 22:06:05 +0100 Subject: [PATCH 18/30] :wrench: Added sleep command before we stop everything --- .travis.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5045922..970a949 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,17 +2,26 @@ os: linux language: minimal services: - docker +env: + global: + - DOCKER_USERNAME=gjacquenot + - secure: NvtIgByN0GmaSqNsTWFtAU8hKhtBqkScSkYMzlwImZaPa5aDfDyach/otae6Zp3dgWmlGR90ui5HrA+4V0DUvrdx3gODyycwzqF2CvoYtOPr6DC1SN5+xb1ty3toBKMlAJyXQRvwSO0oMkOvFRutC8HVBU8A6g+pO4+4pjpu4WfNLBBfWX5Gq4lVlOLZ4L5NH4Es+BNpdNNWVjZPkrdbU3UtjQIfV2bmAF9ws8GTSxi9+DfJT7Zmj4o9aZfAyfnZ8bdRdiEXUcn8Ilbk3rJwbxIq6IPfI0MmqKveHzpYjBrhQhEsr5cLdbhRI4zB235L+l/hzQDrld7+lVGWsZs60Pgw1xeFHH63J5kBT4Ibn3KOdMLyfEQqY2W3aODp3eU7Bkj/8J/s6rc+uBohGyJOM9muTL54OSfNDSb8q4M9Y4S9okSysZuuS6ry/sFn2kMasDYVYeOg+A9XscLj1JXGRL8/hImUuhRbWnyob1F+gbpH1lbgWIAtQ97bHWt4xJs+Fps4LdaXeUZNTb+FIXE9RRe+qbbHX4+ExIkrkFg3JUnmaS37J8XZJmVXw3panv2DuGV2ri1u1DCa1/JpPmB6AbQIL1jfC7FmuqgMbRGg/6U2h5kAAga8gbyEZscMA1DyFhsqgIG/k87oqRiUumvJ9+/m+o9/EV+XvDLjgHzGMvA= before_install: - echo "Before install" before_script: -- echo "Before script" +- docker pull gjacquenot/openstreetmap-tile-server || true script: -- make build -- make test -- make stop +- docker build --pull --cache-from gjacquenot/openstreetmap-tile-server --tag gjacquenot/openstreetmap-tile-server . +- make DOCKER_IMAGE=gjacquenot/openstreetmap-tile-server test +- sleep 30 +- make DOCKER_IMAGE=gjacquenot/openstreetmap-tile-server stop after_script: - docker images after_success: -- if [[ "$TRAVIS_BRANCH" == "master" ]]; then echo "One can push to image dockerhub" ; fi +- if [[ "$TRAVIS_BRANCH" == "master" ]]; + then + docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD ; + docker push gjacquenot/openstreetmap-tile-server ; + fi notifications: email: true From f77c926ee5b75e27a5b7c9cd3337528aa39c9e87 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Sun, 22 Dec 2019 23:58:40 +0100 Subject: [PATCH 19/30] :wrench: Tag docker image so that it can be pushed to dockerhub --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 970a949..7d827cb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,7 @@ after_script: after_success: - if [[ "$TRAVIS_BRANCH" == "master" ]]; then + docker tag overv/openstreetmap-tile-server gjacquenot/openstreetmap-tile-server ; docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD ; docker push gjacquenot/openstreetmap-tile-server ; fi From f69bcd25403f40f04ef367a7a339d50b679837ec Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Mon, 23 Dec 2019 00:17:07 +0100 Subject: [PATCH 20/30] :hammer: Switched from python-mapnik -> python3-mapnik --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 188c9c1..9d20845 100644 --- a/Dockerfile +++ b/Dockerfile @@ -62,7 +62,7 @@ RUN apt-get update \ postgresql-contrib-12 \ postgresql-server-dev-12 \ protobuf-c-compiler \ - python-mapnik \ + python3-mapnik \ python3-lxml \ python3-psycopg2 \ python3-shapely \ From 837a38df045f80c31575bb3bd6fe3d8f5d7660ed Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Mon, 23 Dec 2019 13:27:36 +0100 Subject: [PATCH 21/30] :bug: Fixed remove directory /home/renderer/src --- Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9d20845..c1f34b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -93,6 +93,7 @@ RUN mkdir -p /home/renderer/src \ && cd /home/renderer/src \ && git clone https://github.com/openstreetmap/osm2pgsql.git \ && cd /home/renderer/src/osm2pgsql \ + && rm -rf .git \ && mkdir build \ && cd build \ && cmake .. \ @@ -100,10 +101,11 @@ RUN mkdir -p /home/renderer/src \ && make install \ && mkdir /nodes \ && chown renderer:renderer /nodes \ - && rm -rf /home/renderer/src + && rm -rf /home/renderer/src/osm2pgsql/build # Install mod_tile and renderd RUN mkdir -p /home/renderer/src \ + && cd /home/renderer/src \ && git clone -b switch2osm https://github.com/SomeoneElseOSM/mod_tile.git \ && cd mod_tile \ && ./autogen.sh \ @@ -117,6 +119,7 @@ RUN mkdir -p /home/renderer/src \ # Configure stylesheet RUN mkdir -p /home/renderer/src \ + && cd /home/renderer/src \ && git clone https://github.com/gravitystorm/openstreetmap-carto.git \ && git -C openstreetmap-carto checkout v4.23.0 \ && cd openstreetmap-carto \ From d7922429f3d9bc43f5a982bfd326b67e84736ad1 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Mon, 23 Dec 2019 13:58:23 +0100 Subject: [PATCH 22/30] :sparkles: Added badges in main Readme.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index c3140f5..4f0d4d6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # openstreetmap-tile-server +[![Build Status](https://travis-ci.org/Gjacquenot/openstreetmap-tile-server.svg?branch=master)](https://travis-ci.org/Gjacquenot/openstreetmap-tile-server) + +[![](https://images.microbadger.com/badges/image/gjacquenot/openstreetmap-tile-server.svg)](https://microbadger.com/images/gjacquenot/openstreetmap-tile-server "openstreetmap-tile-server") + This container allows you to easily set up an OpenStreetMap PNG tile server given a `.osm.pbf` file. It is based on the [latest Ubuntu 18.04 LTS guide](https://switch2osm.org/manually-building-a-tile-server-18-04-lts/) from [switch2osm.org](https://switch2osm.org/) and therefore uses the default OpenStreetMap style. ## Setting up the server From 17a2c6d631008f762c6ac5288bf3ecf3b3a0e800 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Mon, 23 Dec 2019 21:46:24 +0100 Subject: [PATCH 23/30] :wrench: Removed boost libraries --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c1f34b3..9e75a9c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,7 +31,8 @@ RUN apt-get update \ gdal-bin \ git-core \ libagg-dev \ - libboost-all-dev \ + libboost-filesystem-dev \ + libboost-system-dev \ libbz2-dev \ libcairo-dev \ libcairomm-1.0-dev \ From 4ca2e8f1e5f815dfa20314a2c64e1dd5560d2102 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Mon, 23 Dec 2019 22:07:06 +0100 Subject: [PATCH 24/30] :wrench: Removed build directory /home/renderer/src/osm2pgsql --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9e75a9c..5f146ea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -102,7 +102,7 @@ RUN mkdir -p /home/renderer/src \ && make install \ && mkdir /nodes \ && chown renderer:renderer /nodes \ - && rm -rf /home/renderer/src/osm2pgsql/build + && rm -rf /home/renderer/src/osm2pgsql # Install mod_tile and renderd RUN mkdir -p /home/renderer/src \ From d0428523b53a17e44551a0cdd133efb6b5bd21ce Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Mon, 23 Dec 2019 22:08:41 +0100 Subject: [PATCH 25/30] :wrench: Switched from postgis-3.0.0rc2 to postgis-3.0.0 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5f146ea..bb0b46f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -78,7 +78,7 @@ RUN apt-get update \ && rm -rf /var/lib/{apt,dpkg,cache,log}/ # Set up PostGIS -RUN wget http://download.osgeo.org/postgis/source/postgis-3.0.0rc2.tar.gz -O postgis.tar.gz \ +RUN wget http://download.osgeo.org/postgis/source/postgis-3.0.0.tar.gz -O postgis.tar.gz \ && mkdir -p postgis_src \ && tar -xvzf postgis.tar.gz --strip 1 -C postgis_src \ && rm postgis.tar.gz \ From e9a26ddded6280b8ae91f725f4b7697f04aabfa2 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Mon, 23 Dec 2019 22:13:04 +0100 Subject: [PATCH 26/30] :hammer: Updated .travis.yml --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7d827cb..970a949 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,6 @@ after_script: after_success: - if [[ "$TRAVIS_BRANCH" == "master" ]]; then - docker tag overv/openstreetmap-tile-server gjacquenot/openstreetmap-tile-server ; docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD ; docker push gjacquenot/openstreetmap-tile-server ; fi From 18c97f52bffa758aca69425fde1c863b7360d440 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Mon, 23 Dec 2019 22:25:09 +0100 Subject: [PATCH 27/30] :hammer: Updated .travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 970a949..205fefb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,7 @@ after_script: after_success: - if [[ "$TRAVIS_BRANCH" == "master" ]]; then + docker images ; docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD ; docker push gjacquenot/openstreetmap-tile-server ; fi From 515dd2a18c68584c097edc3a2f3038ce9a9659f1 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Mon, 23 Dec 2019 23:36:30 +0100 Subject: [PATCH 28/30] :wrench: Updated .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 205fefb..6fa0ad4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ before_script: - docker pull gjacquenot/openstreetmap-tile-server || true script: - docker build --pull --cache-from gjacquenot/openstreetmap-tile-server --tag gjacquenot/openstreetmap-tile-server . -- make DOCKER_IMAGE=gjacquenot/openstreetmap-tile-server test +- touch build && make DOCKER_IMAGE=gjacquenot/openstreetmap-tile-server test - sleep 30 - make DOCKER_IMAGE=gjacquenot/openstreetmap-tile-server stop after_script: From a90f8f1d8c09d7b3e4c4c95875ff877a321704dd Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Tue, 24 Dec 2019 00:02:49 +0100 Subject: [PATCH 29/30] :wrench: Updated .travis.yml --- .travis.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6fa0ad4..2c68038 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,9 @@ before_script: - docker pull gjacquenot/openstreetmap-tile-server || true script: - docker build --pull --cache-from gjacquenot/openstreetmap-tile-server --tag gjacquenot/openstreetmap-tile-server . -- touch build && make DOCKER_IMAGE=gjacquenot/openstreetmap-tile-server test +- docker volume create openstreetmap-data +- docker run --rm -v openstreetmap-data:/var/lib/postgresql/12/main gjacquenot/openstreetmap-tile-server import +- docker run --rm -v openstreetmap-data:/var/lib/postgresql/12/main -p 80:80 -d gjacquenot/openstreetmap-tile-server run - sleep 30 - make DOCKER_IMAGE=gjacquenot/openstreetmap-tile-server stop after_script: @@ -21,7 +23,7 @@ after_success: - if [[ "$TRAVIS_BRANCH" == "master" ]]; then docker images ; - docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD ; + echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin ; docker push gjacquenot/openstreetmap-tile-server ; fi notifications: From dafb4610cd9be2b26ee6060d90e1595637ce8cda Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Wed, 25 Dec 2019 21:49:31 +0100 Subject: [PATCH 30/30] :bug: Fixed removed symbolic link --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index bb0b46f..ba71fc9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -115,8 +115,7 @@ RUN mkdir -p /home/renderer/src \ && make -j $(nproc) install \ && make -j $(nproc) install-mod_tile \ && ldconfig \ - && cd .. \ - && rm -rf mod_tile + && cd .. # Configure stylesheet RUN mkdir -p /home/renderer/src \