FROM alpine:3.7 MAINTAINER Disassembler RUN \ # Modify OS user (which will be picked up later by apk add) sed -i 's/postgres:x:70:70/postgres:x:5432:5432/' /etc/passwd \ && sed -i 's/postgres:x:70/postgres:x:5432/' /etc/group \ # Add edge/testing repository for postgis support && echo '@edgetest http://dl-cdn.alpinelinux.org/alpine/edge/testing' >>/etc/apk/repositories \ && echo '@edgemain http://dl-cdn.alpinelinux.org/alpine/edge/main' >>/etc/apk/repositories \ # Install PostgreSQL + PostGIS (JSON-C is a dependency for PostGIS) && apk --no-cache add json-c@edgemain postgresql postgresql-contrib postgis@edgetest \ # Create socket directory && mkdir /run/postgresql \ && chown postgres:postgres /run/postgresql VOLUME ["/var/lib/postgresql"] EXPOSE 5432 USER postgres CMD ["postgres", "-D", "/var/lib/postgresql"]