Add immich

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-09-30 10:13:59 +01:00
parent 6ce084b652
commit 492b643d8b
18 changed files with 479 additions and 31 deletions

View File

@@ -31,13 +31,18 @@ if [ ! -s "$PGDATA/PG_VERSION" ]; then
POSTGRES_HOST_AUTH_METHOD="${POSTGRES_HOST_AUTH_METHOD:=$auth_method}"
printf "\nhost all all all %s\n" "$POSTGRES_HOST_AUTH_METHOD" >> "$PGDATA/pg_hba.conf"
pg_ctl -w start
pg_ctl -w start -o "-c config_file=/etc/postgresql/postgresql.conf"
if ! psql --username="$POSTGRES_USER" -d postgres -tc "SELECT 1 FROM pg_database WHERE datname = '$POSTGRES_DB'" | grep -q 1; then
psql --username="$POSTGRES_USER" -d postgres -c "CREATE DATABASE \"$POSTGRES_DB\";"
fi
pg_ctl -m fast -w stop
if [ -f /etc/postgresql/init.sh ]; then
# shellcheck disable=SC1091
. /etc/postgresql/init.sh
fi
pg_ctl -m fast -w stop -o "-c config_file=/etc/postgresql/postgresql.conf"
fi
exec postgres -c config_file="/etc/postgresql/postgresql.conf" "$@" > "$LOG_PIPE" 2>&1