diff options
| author | onelin <oscar@nelin.dk> | 2026-07-07 19:04:17 +0000 |
|---|---|---|
| committer | onelin <oscar@nelin.dk> | 2026-07-07 19:04:17 +0000 |
| commit | 56150650dc2f1adfb72301489d926a8a67b82b27 (patch) | |
| tree | 37001a6463e6efec20ad2e45ba9fcdfacb23d7e0 /gitolite/cgit/Dockerfile | |
| parent | f458a536ac8d732e47a8dce4d92aa2f1b5a2c649 (diff) | |
Unify docker image
This makes it easier to manage and unifies the services that essentially
belong together. Might consider making it a split configuration again
later, but for now it makes much more sense such that fail2ban can
better operate with all the available logs instead of managing the
circus that is docker volumes.
Diffstat (limited to 'gitolite/cgit/Dockerfile')
| -rw-r--r-- | gitolite/cgit/Dockerfile | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/gitolite/cgit/Dockerfile b/gitolite/cgit/Dockerfile new file mode 100644 index 0000000..0c41144 --- /dev/null +++ b/gitolite/cgit/Dockerfile @@ -0,0 +1,50 @@ +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 fcgiwrap py3-pygments \ + && tar -xvf /cgit-1.3.tar.gz + +RUN apk update && apk update + +COPY 40-fcgiwrap.sh /docker-entrypoint.d/ +RUN chmod +x /docker-entrypoint.d/40-fcgiwrap.sh + +COPY cgitrc /etc/ + +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 +# +#USER nginx |
