Spotter-VM/postgres/Dockerfile

21 lines
713 B
Docker
Raw Normal View History

2018-07-09 15:14:44 +02:00
FROM alpine:3.8
LABEL maintainer="Disassembler <disassembler@dasm.cz>"
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 '@edge http://dl-cdn.alpinelinux.org/alpine/edge/testing' >>/etc/apk/repositories \
# Install PostgreSQL + PostGIS
&& apk --no-cache add postgresql postgresql-contrib postgis@edge \
# 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"]