Commit 134964c7 authored by Dmitrii Scurtu's avatar Dmitrii Scurtu
Browse files

added dockerfile for postgis image

parents
Pipeline #13775 failed with stage
in 14 seconds
stages:
- build_postgis
build_image_postgis:
image: docker:stable-git
stage: build_postgis
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
services:
- docker:dind
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_JOB_TOKEN git.steelkiwi.com:5005
script:
- echo "$IMAGE:$CI_JOB_ID" > images
- docker build --cache-from $IMAGE:cache -t $IMAGE:latest -f postgis/Dockerfile_develop .
- docker push $IMAGE:latest
only:
- postgis
tags:
- django_tests
\ No newline at end of file
FROM postgres:10-alpine
MAINTAINER SteelKiwi Inc.
ENV POSTGIS_VERSION 2.5.2
RUN set -ex && apk --update add --no-cache \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
--virtual .packages \
make \
geos-dev \
proj4-dev \
gdal-dev \
json-c-dev \
g++ \
perl \
libxml2-dev
RUN set -ex && mkdir /tmp/postgis \
&& wget -O postgis.tar.gz "https://download.osgeo.org/postgis/source/postgis-$POSTGIS_VERSION.tar.gz" \
&& tar --extract \
--file postgis.tar.gz \
--directory /tmp/postgis \
--strip-components 1 \
&& rm postgis.tar.gz \
&& cd /tmp/postgis \
&& ./configure \
&& make \
&& make install \
&& rm -rf /tmp/postgis \
&& apk del .packages
RUN set -ex && apk add --no-cache \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
geos \
proj4 \
gdal \
json-c \
libxml2
COPY ./postgis.sh /docker-entrypoint-initdb.d/postgis.sh
\ No newline at end of file
#!/usr/bin/env sh
set -e
export PGUSER="$POSTGRES_USER"
psql <<- EOSQL
CREATE EXTENSION IF NOT EXISTS postgis;
CREATE EXTENSION IF NOT EXISTS postgis_topology;
EOSQL
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment