mirror of
https://github.com/wassname/docker-postgresql.git
synced 2026-06-28 11:20:04 +08:00
Dockerfile: added PG_RUNDIR variable
This commit is contained in:
+3
-2
@@ -3,7 +3,8 @@ MAINTAINER sameer@damagehead.com
|
||||
|
||||
ENV PG_VERSION=9.4 \
|
||||
PG_USER=postgres \
|
||||
PG_HOME="/var/lib/postgresql"
|
||||
PG_HOME=/var/lib/postgresql \
|
||||
PG_RUNDIR=/run/postgresql
|
||||
|
||||
ENV PG_CONFDIR="/etc/postgresql/${PG_VERSION}/main" \
|
||||
PG_BINDIR="/usr/lib/postgresql/${PG_VERSION}/bin" \
|
||||
@@ -20,5 +21,5 @@ COPY entrypoint.sh /sbin/entrypoint.sh
|
||||
RUN chmod 755 /sbin/entrypoint.sh
|
||||
|
||||
EXPOSE 5432/tcp
|
||||
VOLUME ["${PG_HOME}", "/run/postgresql"]
|
||||
VOLUME ["${PG_HOME}", "${PG_RUNDIR}"]
|
||||
CMD ["/sbin/entrypoint.sh"]
|
||||
|
||||
+4
-4
@@ -42,10 +42,10 @@ chown -R ${PG_USER}:${PG_USER} ${PG_CONFDIR}
|
||||
mkdir -p -m 0700 ${PG_HOME}
|
||||
chown -R ${PG_USER}:${PG_USER} ${PG_HOME}
|
||||
|
||||
# fix permissions and ownership of /run/postgresql
|
||||
mkdir -p -m 0755 /run/postgresql /run/postgresql/${PG_VERSION}-main.pg_stat_tmp
|
||||
chown -R ${PG_USER}:${PG_USER} /run/postgresql
|
||||
chmod g+s /run/postgresql
|
||||
# fix permissions and ownership of ${PG_RUNDIR}
|
||||
mkdir -p -m 0755 ${PG_RUNDIR} ${PG_RUNDIR}/${PG_VERSION}-main.pg_stat_tmp
|
||||
chown -R ${PG_USER}:${PG_USER} ${PG_RUNDIR}
|
||||
chmod g+s ${PG_RUNDIR}
|
||||
|
||||
if [[ ${PSQL_SSLMODE} == disable ]]; then
|
||||
sed 's/ssl = true/#ssl = true/' -i ${PG_CONFDIR}/postgresql.conf
|
||||
|
||||
Reference in New Issue
Block a user