Skip to content

Commit

Permalink
Update Tiler containers
Browse files Browse the repository at this point in the history
  • Loading branch information
Rub21 committed Jul 4, 2024
1 parent 1719642 commit 51be526
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 74 deletions.
22 changes: 10 additions & 12 deletions compose/tiler.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3.8'
# version: '3.8'
services:
# ######################################################
# ### Tiler DB
Expand All @@ -8,16 +8,16 @@ services:
build:
context: ../images/tiler-db
dockerfile: Dockerfile
# ports:
# - "5433:5432"
ports:
- "5432:5432"
volumes:
- ../data/tiler-db-data:/var/lib/postgresql/data
env_file:
- ../envs/.env.tiler-db
restart: always
# ######################################################
# ### Tiler imposm for importing data
# ######################################################
# # ######################################################
# # ### Tiler imposm for importing data
# # ######################################################
tiler-imposm:
image: osmseed-tiler-imposm:v1
build:
Expand All @@ -26,12 +26,10 @@ services:
volumes:
- ../data/tiler-imposm-data:/mnt/data
# - ../images/tiler-imposm:/osm
depends_on:
- tiler-db
command:
- sh
- -c
- "sleep 60 && ./start.sh"
- "./start.sh"
env_file:
- ../envs/.env.tiler-db
- ../envs/.env.tiler-imposm
Expand All @@ -41,9 +39,9 @@ services:
timeout: 10s
retries: 3
restart: always
# ######################################################
# ### Tiler server
# ######################################################
# # ######################################################
# # ### Tiler server
# # ######################################################
tiler-server:
image: osmseed-tiler-server:v1
build:
Expand Down
12 changes: 4 additions & 8 deletions images/tiler-db/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
FROM mdillon/postgis:9.5
RUN rm /etc/apt/sources.list.d/pgdg.list
RUN sed -i s/deb.debian.org/archive.debian.org/g /etc/apt/sources.list
RUN sed -i 's|security.debian.org|archive.debian.org|g' /etc/apt/sources.list
RUN sed -i '/stretch-updates/d' /etc/apt/sources.list
RUN apt-get update && apt-get -y install apt-transport-https
RUN echo "deb https://apt-archive.postgresql.org/pub/repos/apt/ stretch-pgdg main 9.5" /etc/apt/sources.list.d/pgdg.list
RUN apt-get update && apt-get install -y git ca-certificates
FROM postgis/postgis:14-3.4
RUN apt-get update
RUN apt-get install -y git ca-certificates

COPY ./config/docker-entrypoint.sh /usr/local/bin/
RUN mkdir -p /docker-entrypoint-initdb.d
COPY ./config/initdb_db.sh /docker-entrypoint-initdb.d/postgis.sh
Expand Down
24 changes: 7 additions & 17 deletions images/tiler-db/config/initdb_db.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
#!/bin/sh
set -e

# Create the 'template_postgis' template db
"${psql[@]}" <<- 'EOSQL'
CREATE DATABASE template_postgis;
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis';
EOSQL

# Load PostGIS into both template_database and $POSTGRES_DB
for DB in template_postgis "$POSTGRES_DB"; do
echo "Loading PostGIS extensions into $DB"
"${psql[@]}" --dbname="$DB" <<-'EOSQL'
CREATE EXTENSION IF NOT EXISTS postgis;
CREATE EXTENSION IF NOT EXISTS postgis_topology;
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;
CREATE EXTENSION IF NOT EXISTS hstore;
EOSQL
done
# Add hstore into the DB
for DB in template_postgis "$POSTGRES_DB" "${@}"; do
echo "Updating extensions '$DB'"
psql --dbname="$DB" -c "
CREATE EXTENSION IF NOT EXISTS hstore;
"
done
49 changes: 12 additions & 37 deletions images/tiler-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,47 +1,22 @@
FROM golang:1.14.1-alpine3.11 AS build
ENV VERSION="v0.8.1"
RUN apk update
RUN apk add musl-dev=1.1.24-r3 \
gcc \
bash \
git \
postgresql \
postgresql-contrib

RUN mkdir -p /go/src/github.com/go-spatial/tegola
RUN git clone https://github.com/go-spatial/tegola.git /go/src/github.com/go-spatial/tegola
RUN cd /go/src/github.com/go-spatial/tegola && git checkout v0.13.0
RUN cd /go/src/github.com/go-spatial/tegola/cmd/tegola \
&& go build -gcflags "-N -l" -o /opt/tegola \
&& chmod a+x /opt/tegola
RUN ln -s /opt/tegola /usr/bin/tegola
FROM gospatial/tegola:v0.20.0

RUN apk add --update \
python3 \
py-pip \
py-cffi \
py-cryptography \
&& pip install --upgrade pip \
&& apk add --virtual build-deps \
RUN apk --no-cache add \
gcc \
libffi-dev \
python3-dev \
python3 \
py3-pip \
py3-cffi \
py3-cryptography \
linux-headers \
musl-dev \
openssl-dev \
curl

# Install aws-cli and gsutil
RUN pip3 install awscli
RUN curl -sSL https://sdk.cloud.google.com | bash
RUN ln -f -s /root/google-cloud-sdk/bin/gsutil /usr/bin/gsutil

RUN pip3 install mercantile \
&& apk del build-deps \
&& rm -rf /var/cache/apk/* \
&& apk --purge -v del py-pip
bash \
git \
postgresql-client \
coreutils \
jq

RUN apk add --update coreutils jq && rm -rf /var/cache/apk/*
RUN pip install --upgrade pip && pip3 install awscli mercantile

# Volumen
VOLUME /mnt/data
Expand Down

0 comments on commit 51be526

Please sign in to comment.