Files
mtusi2026lab7-fork/infra/postgres/entrypoint.sh

11 lines
687 B
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/sh
# lab7: PostgreSQL с TLS. Контейнер работает сразу от uid 70 (postgres), без root и
# без capabilities. PostgreSQL требует, чтобы приватный ключ принадлежал ему и имел
# права 0600; bind-mount secrets (особенно на Windows) этого не гарантирует, поэтому
# ключ копируется в tmpfs /run/pgtls (только этот контейнер, только память) с 0600.
set -eu
umask 077
install -m 0600 /run/secrets/postgres_key /run/pgtls/server.key
install -m 0644 /run/secrets/postgres_crt /run/pgtls/server.crt
exec docker-entrypoint.sh "$@"