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 --- Dockerfile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 67f15b6..1dfb37b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,11 +28,8 @@ FROM httpd:${APACHE_VERSION} RUN apk add --no-cache luajit -RUN addgroup -g 1000 cgit \ - && adduser -D -H -u 1000 -G cgit cgit - -RUN sed -i 's/^User www-data/User cgit/' /usr/local/apache2/conf/httpd.conf -RUN sed -i 's/^Group www-data/Group cgit/' /usr/local/apache2/conf/httpd.conf +RUN sed -i 's/^\(User\) www-data/\1 cgit/' /usr/local/apache2/conf/httpd.conf +RUN sed -i 's/^\(Group\) www-data/\1 cgit/' /usr/local/apache2/conf/httpd.conf RUN sed -i 's/#\(LoadModule cgi_module\)/\1/' /usr/local/apache2/conf/httpd.conf RUN sed -i 's/#\(LoadModule cgid_module\)/\1/' /usr/local/apache2/conf/httpd.conf RUN echo -e "\n#cgit configuration\nInclude conf/extra/cgit.conf" >> /usr/local/apache2/conf/httpd.conf @@ -41,7 +38,12 @@ ENV CGIT_APP_USER=cgit COPY ./rootfs/ / COPY --from=build /opt/cgit /opt/cgit -RUN chown cgit:cgit -R /opt/cgit +RUN chmod 755 -R /opt/cgit + +COPY entrypoint.sh /usr/local/bin/entrypoint.sh +RUN chmod +x /usr/local/bin/entrypoint.sh VOLUME ["/opt/git"] +ENTRYPOINT ["entrypoint.sh"] +CMD ["httpd-foreground"] EXPOSE 80 -- cgit v1.3.1