10 lines
647 B
Bash
10 lines
647 B
Bash
#!/bin/sh
|
|
# PostgreSQL refuses a key that is not owned by the server user with mode 0600: copy the mounted key into a private tmpfs first.
|
|
set -eu
|
|
install -d -m 700 -o postgres -g postgres /tls
|
|
install -m 644 -o postgres -g postgres /pki/tls.crt /tls/server.crt
|
|
install -m 600 -o postgres -g postgres /pki/tls.key /tls/server.key
|
|
install -m 644 -o postgres -g postgres /pki/ca.crt /tls/ca.crt
|
|
exec docker-entrypoint.sh postgres -c ssl=on -c ssl_cert_file=/tls/server.crt -c ssl_key_file=/tls/server.key \
|
|
-c ssl_ca_file=/tls/ca.crt -c ssl_min_protocol_version=TLSv1.2 -c hba_file=/etc/postgresql/pg_hba.conf -c password_encryption=scram-sha-256
|