mirror of
https://github.com/wassname/docker-postgresql.git
synced 2026-07-05 07:20:44 +08:00
+7
-4
@@ -7,14 +7,16 @@ ENV PG_VERSION=9.4 \
|
||||
PG_RUNDIR=/run/postgresql \
|
||||
PG_LOGDIR=/var/log/postgresql
|
||||
|
||||
ENV PG_BINDIR="/usr/lib/postgresql/${PG_VERSION}/bin" \
|
||||
PG_CONFDIR="${PG_HOME}/${PG_VERSION}/main" \
|
||||
PG_DATADIR="${PG_HOME}/${PG_VERSION}/main"
|
||||
ENV PG_BINDIR=/usr/lib/postgresql/${PG_VERSION}/bin \
|
||||
PG_DATADIR=${PG_HOME}/${PG_VERSION}/main
|
||||
|
||||
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
|
||||
&& echo 'deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main' > /etc/apt/sources.list.d/pgdg.list \
|
||||
&& apt-get update \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y postgresql-${PG_VERSION} postgresql-client-${PG_VERSION} postgresql-contrib-${PG_VERSION} \
|
||||
&& ln -sf ${PG_DATADIR}/postgresql.conf /etc/postgresql/${PG_VERSION}/main/postgresql.conf \
|
||||
&& ln -sf ${PG_DATADIR}/pg_hba.conf /etc/postgresql/${PG_VERSION}/main/pg_hba.conf \
|
||||
&& ln -sf ${PG_DATADIR}/pg_ident.conf /etc/postgresql/${PG_VERSION}/main/pg_ident.conf \
|
||||
&& rm -rf ${PG_HOME} \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
@@ -23,4 +25,5 @@ RUN chmod 755 /sbin/entrypoint.sh
|
||||
|
||||
EXPOSE 5432/tcp
|
||||
VOLUME ["${PG_HOME}", "${PG_RUNDIR}"]
|
||||
CMD ["/sbin/entrypoint.sh"]
|
||||
WORKDIR ${PG_HOME}
|
||||
ENTRYPOINT ["/sbin/entrypoint.sh"]
|
||||
|
||||
Reference in New Issue
Block a user