2018-07-09 15:14:44 +02:00
|
|
|
FROM alpine:3.8
|
2018-09-03 22:12:08 +02:00
|
|
|
LABEL maintainer="Disassembler <disassembler@dasm.cz>"
|
2017-12-15 16:20:09 +01:00
|
|
|
|
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-07-09 18:12:53 +02:00
|
|
|
&& 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 \
|
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"]
|