From 0701e4d908f407c8893d8c3fcd5e1ea4dec0e937 Mon Sep 17 00:00:00 2001 From: Matthias Lucas Jaros Date: Sat, 11 Jul 2026 11:29:08 +0200 Subject: Added entrypoint file to adjust uid and gid on the fly using docker-compose --- entrypoint.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 entrypoint.sh (limited to 'entrypoint.sh') diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..f6b0b54 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,20 @@ +#!/bin/sh +set -eu + +: "${PUID:=1000}" +: "${PGID:=1000}" + +# Create group at container start +if ! grep -q '^cgit:' /etc/group; then + addgroup -g "$PGID" cgit +fi + +# Create user at container start +if ! grep -q '^cgit:' /etc/passwd; then + adduser -D -H -u "$PUID" -G cgit cgit +fi + +# Make cache writable for Apache/cgit +chown -R "$PUID:$PGID" /opt/cgit/cache + +exec "$@" -- cgit v1.3.1