From f458a536ac8d732e47a8dce4d92aa2f1b5a2c649 Mon Sep 17 00:00:00 2001 From: onelin Date: Thu, 2 Apr 2026 19:39:35 +0200 Subject: Add compiled cgit 1.3 Also includes: * Everforest theme * Automatic last-modified hooks * Update to icon and logo --- cgit/Dockerfile | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) (limited to 'cgit/Dockerfile') diff --git a/cgit/Dockerfile b/cgit/Dockerfile index e89b8d3..007fe23 100644 --- a/cgit/Dockerfile +++ b/cgit/Dockerfile @@ -1,8 +1,27 @@ +FROM nginx:1.29.7-alpine-slim AS build + +RUN set -x \ + && apk add --no-cache gcc make curl linux-headers musl-dev zlib-dev libressl-dev libintl musl-libintl + +RUN wget 'https://git.zx2c4.com/cgit/snapshot/cgit-1.3.tar.xz' \ + && tar -xvf cgit-1.3.tar.xz + +WORKDIR /cgit-1.3 +RUN make get-git \ + && DESTDIR=pkg NO_REGEX=NeedsStartEnd make install + +WORKDIR /cgit-1.3/pkg +RUN tar -czvf cgit-1.3.tar.gz . + + FROM nginx:1.29.7-alpine-slim +COPY --from=build /cgit-1.3/pkg/cgit-1.3.tar.gz /cgit-1.3.tar.gz + ARG DOMAIN=localhost RUN set -x \ - && apk add --no-cache cgit fcgiwrap envsubst + && apk add --no-cache fcgiwrap envsubst \ + && tar -xvf /cgit-1.3.tar.gz RUN apk update && apk update @@ -11,12 +30,20 @@ RUN chmod +x /docker-entrypoint.d/40-fcgiwrap.sh COPY cgitrc /etc/ -COPY site.template / -RUN sed "s/\$DOMAIN/$DOMAIN/g" /site.template > /etc/nginx/conf.d/default.conf -RUN rm /site.template +COPY nginx.conf / +RUN sed "s/\$DOMAIN/$DOMAIN/g" /nginx.conf > /etc/nginx/conf.d/default.conf +RUN rm /nginx.conf RUN addgroup nginx www-data +COPY about.html /var/www/htdocs/cgit/ +COPY cgit.png /var/www/htdocs/cgit/logo.png +COPY favicon.ico /var/www/htdocs/cgit/ + +COPY css_variable_colors.sh / +COPY everforest.css /var/www/htdocs/cgit/ +RUN sh css_variable_colors.sh + #RUN sed -i -Ee 's/pid\s+.*;/pid \/tmp\/nginx.pid;/' /etc/nginx/nginx.conf #RUN sed -i -Ee 's/error_log\s+.*;/error_log \/dev\/stdout;/' /etc/nginx/nginx.conf # -- cgit v1.3