kopia lustrzana https://github.com/kartoza/docker-postgis
64 wiersze
2.2 KiB
Docker
64 wiersze
2.2 KiB
Docker
#--------- Generic stuff all our Dockerfiles should start with so we get caching ------------
|
|
ARG IMAGE_VERSION=buster
|
|
FROM debian:$IMAGE_VERSION
|
|
MAINTAINER Tim Sutton<tim@kartoza.com>
|
|
|
|
# Reset ARG for version
|
|
ARG IMAGE_VERSION
|
|
RUN export DEBIAN_FRONTEND=noninteractive
|
|
ENV DEBIAN_FRONTEND noninteractive
|
|
RUN dpkg-divert --local --rename --add /sbin/initctl
|
|
|
|
RUN apt-get -y update; apt-get -y install gnupg2 wget ca-certificates rpl pwgen gdal-bin
|
|
|
|
RUN sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ ${IMAGE_VERSION}-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
|
|
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc -O- | apt-key add -
|
|
|
|
#-------------Application Specific Stuff ----------------------------------------------------
|
|
|
|
# We add postgis as well to prevent build errors (that we dont see on local builds)
|
|
# on docker hub e.g.
|
|
# The following packages have unmet dependencies:
|
|
RUN apt-get update; apt-get install -y postgresql-client-12 postgresql-common postgresql-12 postgresql-12-postgis-3 netcat postgresql-12-ogr-fdw postgresql-12-postgis-3-scripts
|
|
|
|
# Open port 5432 so linked containers can see them
|
|
EXPOSE 5432
|
|
|
|
# Run any additional tasks here that are too tedious to put in
|
|
# this dockerfile directly.
|
|
ADD env-data.sh /env-data.sh
|
|
ADD setup.sh /setup.sh
|
|
RUN chmod +x /setup.sh
|
|
RUN /setup.sh
|
|
|
|
ADD locale.gen /etc/locale.gen
|
|
RUN /usr/sbin/locale-gen
|
|
ENV LANG en_US.UTF-8
|
|
ENV LANGUAGE en_US:en
|
|
ENV LC_ALL en_US.UTF-8
|
|
RUN update-locale ${LANG}
|
|
|
|
# We will run any commands in this when the container starts
|
|
ADD docker-entrypoint.sh /docker-entrypoint.sh
|
|
ADD setup-conf.sh /
|
|
ADD setup-database.sh /
|
|
ADD setup-pg_hba.sh /
|
|
ADD setup-replication.sh /
|
|
ADD setup-ssl.sh /
|
|
ADD setup-user.sh /
|
|
RUN chmod +x /docker-entrypoint.sh
|
|
|
|
ENTRYPOINT /docker-entrypoint.sh
|
|
|
|
# Compile and install PointCloud.
|
|
# NOTE: release 1.2.0 would not build against PostgreSQL-12:
|
|
# https://github.com/pgpointcloud/pointcloud/issues/248
|
|
RUN apt-get -y update; apt-get -y install build-essential autoconf \
|
|
postgresql-server-dev-12 libxml2-dev zlib1g-dev
|
|
RUN wget -O- \
|
|
https://github.com/pgpointcloud/pointcloud/archive/master.tar.gz \
|
|
| tar xz && \
|
|
cd pointcloud-master && \
|
|
./autogen.sh && ./configure && make && make install && \
|
|
cd .. && rm -Rf pointcloud-master
|