-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile16
56 lines (42 loc) · 1.85 KB
/
Dockerfile16
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Adapted from https://github.com/partlab/docker/blob/master/ubuntu-postgresql/Dockerfile
# and https://github.com/docker-library/postgres/blob/master/9.5/docker-entrypoint.sh
FROM credocker/creubuntu:2016.0
MAINTAINER Michael Kahle <[email protected]>
ARG BUILD_YEAR=2016
ARG BUILD_MONTH=0
ARG BUILD_TAG=latest
#ENV DEBIAN_FRONTEND noninteractive
#ENV INITRD No
ENV POSTGRES_VERSION 9.5
#9.5.19
LABEL Name="Postgres for CRE" \
Year=$BUILD_YEAR \
Month=$BUILD_MONTH \
Version=$POSTGRES_VERSION \
OS="Ubuntu:$UBUNTU_VERSION" \
Build_=$CRE_VERSION
RUN add-apt-repository ppa:ubuntugis/ppa
RUN apt-get update && \
apt-get install -y -q --no-install-recommends \
postgresql-$POSTGRES_VERSION postgresql-client-$POSTGRES_VERSION postgresql-contrib-$POSTGRES_VERSION && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/$POSTGRES_VERSION/main/pg_hba.conf && \
echo "listen_addresses='*'" >> /etc/postgresql/$POSTGRES_VERSION/main/postgresql.conf && \
rm -rf /var/lib/postgresql/$POSTGRES_VERSION/main && \
update-rc.d -f postgresql disable
#ADD run /usr/local/bin/run
#RUN chmod +x /usr/local/bin/run
RUN mkdir -p /var/run/postgresql/${POSTGRES_VERSION}-main.pg_stat_tmp
RUN chown postgres.postgres /var/run/postgresql/${POSTGRES_VERSION}-main.pg_stat_tmp -R
RUN mkdir -p /cre && touch /cre/versions.txt && \
echo "$(date +'%F %R') \t crePostgres \t $(/usr/lib/postgresql/${POSTGRES_VERSION}/bin/postgres --version)" >> /cre/versions.txt && \
echo "$(date +'%F %R') \t psql \t $(psql --version)" >> /cre/versions.txt
COPY cre /cre
WORKDIR /cre/
RUN chown -R postgres.postgres /cre
VOLUME ["/var/lib/postgresql", "/cre/postgres"]
EXPOSE 5432
USER postgres
ENTRYPOINT ["/cre/postgres-entrypoint.sh"]
CMD ["shoreman", "/cre/postgres-procfile"]