mirror of
https://github.com/wassname/docker-postgresql.git
synced 2026-08-12 12:00:50 +08:00
defined /etc/postgresql/certs as the mountpoint to install SSL key and certificate
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
- `PSQL_TRUST_LOCALNET` config parameter renamed to `PG_TRUST_LOCALNET`
|
- `PSQL_TRUST_LOCALNET` config parameter renamed to `PG_TRUST_LOCALNET`
|
||||||
- `PSQL_MODE` config parameter renamed to `REPLICATION_MODE`
|
- `PSQL_MODE` config parameter renamed to `REPLICATION_MODE`
|
||||||
- `PSQL_SSLMODE` config parameter renamed to `REPLICATION_SSLMODE`
|
- `PSQL_SSLMODE` config parameter renamed to `REPLICATION_SSLMODE`
|
||||||
|
- defined `/etc/postgresql/certs` as the mountpoint to install SSL key and certificate
|
||||||
|
|
||||||
**9.4-2**
|
**9.4-2**
|
||||||
- added replication options
|
- added replication options
|
||||||
|
|||||||
+2
-1
@@ -5,7 +5,8 @@ ENV PG_VERSION=9.4 \
|
|||||||
PG_USER=postgres \
|
PG_USER=postgres \
|
||||||
PG_HOME=/var/lib/postgresql \
|
PG_HOME=/var/lib/postgresql \
|
||||||
PG_RUNDIR=/run/postgresql \
|
PG_RUNDIR=/run/postgresql \
|
||||||
PG_LOGDIR=/var/log/postgresql
|
PG_LOGDIR=/var/log/postgresql \
|
||||||
|
PG_CERTDIR=/etc/postgresql/certs
|
||||||
|
|
||||||
ENV PG_BINDIR=/usr/lib/postgresql/${PG_VERSION}/bin \
|
ENV PG_BINDIR=/usr/lib/postgresql/${PG_VERSION}/bin \
|
||||||
PG_DATADIR=${PG_HOME}/${PG_VERSION}/main
|
PG_DATADIR=${PG_HOME}/${PG_VERSION}/main
|
||||||
|
|||||||
@@ -59,6 +59,15 @@ create_datadir() {
|
|||||||
chown -R ${PG_USER}:${PG_USER} ${PG_HOME}
|
chown -R ${PG_USER}:${PG_USER} ${PG_HOME}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
create_certdir() {
|
||||||
|
echo "Initializing certdir..."
|
||||||
|
mkdir -p ${PG_CERTDIR}
|
||||||
|
[[ -f ${PG_CERTDIR}/server.crt ]] && chmod 0644 ${PG_CERTDIR}/server.crt
|
||||||
|
[[ -f ${PG_CERTDIR}/server.key ]] && chmod 0640 ${PG_CERTDIR}/server.key
|
||||||
|
chmod 0755 ${PG_CERTDIR}
|
||||||
|
chown -R root:${PG_USER} ${PG_CERTDIR}
|
||||||
|
}
|
||||||
|
|
||||||
create_logdir() {
|
create_logdir() {
|
||||||
echo "Initializing logdir..."
|
echo "Initializing logdir..."
|
||||||
mkdir -p ${PG_LOGDIR}
|
mkdir -p ${PG_LOGDIR}
|
||||||
@@ -327,6 +336,7 @@ if [[ -z ${1} ]]; then
|
|||||||
locale_gen
|
locale_gen
|
||||||
|
|
||||||
create_datadir
|
create_datadir
|
||||||
|
create_certdir
|
||||||
create_logdir
|
create_logdir
|
||||||
create_rundir
|
create_rundir
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user