diff --git a/compose/osmcoastline.yml b/compose/osmcoastline.yml new file mode 100644 index 00000000..ee42d5b5 --- /dev/null +++ b/compose/osmcoastline.yml @@ -0,0 +1,16 @@ +version: '3' +services: + ##################################################### + ## OSM Coastline + ##################################################### + osmcoastline: + platform: linux/amd64 + image: osmseed-osmcoastline:v1 + build: + context: ../images/osmcoastline + dockerfile: Dockerfile + volumes: + - ../data/osmcoastline-data:/mnt/data + env_file: + - ../envs/.env.osmcoastline + \ No newline at end of file diff --git a/envs/.env.osmcoastline.example b/envs/.env.osmcoastline.example new file mode 100644 index 00000000..6e8090a1 --- /dev/null +++ b/envs/.env.osmcoastline.example @@ -0,0 +1 @@ +IMPORT_PBF_URL=https://download.geofabrik.de/europe/monaco-latest.osm.pbf \ No newline at end of file diff --git a/images/osmcoastline/Dockerfile b/images/osmcoastline/Dockerfile new file mode 100644 index 00000000..12391ee0 --- /dev/null +++ b/images/osmcoastline/Dockerfile @@ -0,0 +1,84 @@ +FROM ubuntu:20.04 +ENV workdir /mnt/data + +RUN apt-get -y update +RUN DEBIAN_FRONTEND=noninteractive apt-get -y install \ + build-essential \ + libboost-program-options-dev \ + libbz2-dev \ + zlib1g-dev \ + libexpat1-dev \ + cmake \ + pandoc \ + git \ + python3 \ + python3-pip \ + curl \ + unzip \ + wget \ + software-properties-common \ + libz-dev \ + gdal-bin \ + tar \ + bzip2 \ + clang \ + default-jre \ + default-jdk \ + gradle \ + apt-utils \ + postgresql-client \ + libgeos-dev \ + sqlite3 \ + spatialite-bin + + +#Install osmium-tool +RUN apt-get -y install \ + libbz2-dev \ + libgd-dev \ + libprotozero-dev \ + libsqlite3-dev \ + make \ + jq \ + ca-certificates \ + liblz4-dev + +WORKDIR /home +RUN git clone https://github.com/osmcode/libosmium.git +RUN cd libosmium && git checkout v2.18.0 +RUN cd libosmium && mkdir build +WORKDIR /home/libosmium/build +RUN cmake .. +RUN make .. + +# Other useful packages +RUN apt-get install -y \ + rsync \ + tmux \ + zsh \ + libgdal-dev + +WORKDIR /home +RUN echo 'hello' +RUN git clone https://github.com/osmcode/osmcoastline.git +RUN cd osmcoastline && git checkout v2.3.1 && mkdir build +WORKDIR /home/osmcoastline/build +RUN cmake .. +RUN make +RUN ln -s "$PWD"/src/osmcoastline /usr/local/bin/osmcoastline +RUN osmcoastline --version +# # Install AWS CLI +# RUN pip install awscli + +# # Install GCP CLI +# RUN curl -sSL https://sdk.cloud.google.com | bash +# RUN ln -f -s /root/google-cloud-sdk/bin/gsutil /usr/bin/gsutil + +# # Install Azure CLI +# RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash + +VOLUME $workdir +WORKDIR $workdir +COPY start.sh /start.sh +RUN chmod +x /start.sh +CMD /start.sh diff --git a/images/osmcoastline/start.sh b/images/osmcoastline/start.sh new file mode 100755 index 00000000..fdeb0e0f --- /dev/null +++ b/images/osmcoastline/start.sh @@ -0,0 +1,5 @@ +set -e + +echo "Running coastline on $IMPORT_PBF_URL" +wget $IMPORT_PBF_URL -O planet.pbf +osmcoastline -o coastline.db planet.pbf