#!/bin/bash # 捕获 SIGINT / SIGTERM / SIGQUIT 信号以优雅退出 cleanup() { echo "[postgres] Caught termination signal, shutting down..." exit 0 } trap cleanup SIGINT SIGQUIT SIGTERM exec /usr/local/bin/docker-entrypoint.sh postgres -D /etc/postgresql