2017-12-15 16:20:09 +01:00
|
|
|
FROM alpine:3.7
|
|
|
|
MAINTAINER Disassembler <disassembler@dasm.cz>
|
|
|
|
|
2017-12-21 10:39:07 +01:00
|
|
|
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 \
|
2017-12-15 16:20:09 +01:00
|
|
|
&& sed -i 's/postgres:x:70/postgres:x:5432/' /etc/group \
|
2017-12-21 10:39:07 +01:00
|
|
|
# Add edge/testing repository for postgis support
|
2018-04-05 14:05:22 +02:00
|
|
|
&& echo '@edge http://dl-cdn.alpinelinux.org/alpine/edge/testing' >>/etc/apk/repositories \
|
2017-12-21 10:39:07 +01:00
|
|
|
# Install PostgreSQL + PostGIS
|
2018-04-05 14:05:22 +02:00
|
|
|
&& apk --no-cache add postgresql postgresql-contrib postgis@edge \
|
2017-12-21 10:39:07 +01:00
|
|
|
# Create socket directory
|
2017-12-15 16:20:09 +01:00
|
|
|
&& mkdir /run/postgresql \
|
|
|
|
&& chown postgres:postgres /run/postgresql
|
|
|
|
|
|
|
|
VOLUME ["/var/lib/postgresql"]
|
|
|
|
EXPOSE 5432
|
|
|
|
|
|
|
|
USER postgres
|
|
|
|
CMD ["postgres", "-D", "/var/lib/postgresql"]
|