borders/db/Dockerfile.db

37 lines
1.2 KiB
Text

FROM postgres:12
WORKDIR /borders/
RUN apt-get update && apt-get install -y \
wget \
postgresql-contrib `# contains hstore extension` \
postgresql-12-postgis-3 \
osmctools \
osm2pgsql \
python3 \
python3-psycopg2
##git clone https://github.com/mapsme/borders.git mapsme_borders
ARG PLANET_URL=http://download.geofabrik.de/europe/andorra-latest.osm.pbf
ENV PLANET=planet-file
RUN wget "${PLANET_URL}" -O "${PLANET}"
ENV FILTERED_PLANET=${PLANET}-filtered.o5m
COPY prepare_borders.sh tiles2pg.py prepare_tiles.sh ./
RUN ["/bin/bash", "prepare_borders.sh"]
RUN ["/bin/bash", "prepare_tiles.sh"]
RUN chmod a+w /borders/
COPY init_databases.sh /docker-entrypoint-initdb.d/00-init_databases.sh
COPY create_extensions.sql /docker-entrypoint-initdb.d/01-create_extensions.sql
COPY load_borders.sh /docker-entrypoint-initdb.d/10-load_borders.sh
COPY create_tables.sql /docker-entrypoint-initdb.d/20-create_tables.sql
COPY load_tiles.sh /docker-entrypoint-initdb.d/30-load_tiles.sh
COPY create_osm_cities_table.sql /docker-entrypoint-initdb.d/40-create_osm_cities_table.sql
COPY load_osm_cities_table.sh /docker-entrypoint-initdb.d/41-load_osm_cities_table.sh