aboutsummaryrefslogtreecommitdiff
path: root/gitolite/Dockerfile
diff options
context:
space:
mode:
authoronelin <oscar@nelin.dk>2026-07-07 19:59:12 +0000
committeronelin <oscar@nelin.dk>2026-07-07 19:59:12 +0000
commitdb228bf139b670789972ffb6a00595c4dbca0c0b (patch)
treef34ada6ba5bc81363727e531de51b6e935905934 /gitolite/Dockerfile
parent56150650dc2f1adfb72301489d926a8a67b82b27 (diff)
Cleanup and minor fixes
Diffstat (limited to 'gitolite/Dockerfile')
-rw-r--r--gitolite/Dockerfile34
1 files changed, 14 insertions, 20 deletions
diff --git a/gitolite/Dockerfile b/gitolite/Dockerfile
index 44af1f0..cdb1c7a 100644
--- a/gitolite/Dockerfile
+++ b/gitolite/Dockerfile
@@ -2,7 +2,8 @@
FROM alpine:3.23.3 AS build
RUN set -x \
- && apk add --no-cache gcc g++ cmake make curl linux-headers musl-dev zlib-dev libressl-dev libintl musl-libintl
+ && apk add --no-cache gcc g++ cmake make curl linux-headers musl-dev zlib-dev \
+ libressl-dev libintl musl-libintl
# Compile cgit
RUN set -x \
@@ -11,10 +12,6 @@ RUN set -x \
&& make -C /cgit-1.3 get-git \
&& DESTDIR=/pkg NO_REGEX=NeedsStartEnd make -C /cgit-1.3 install
-
- #&& tar -czvf deps.tar.gz -C /cgit-1.3/pkg .
-
-
# Compile cmark-gfm
RUN set -x \
&& wget https://github.com/github/cmark-gfm/archive/refs/tags/0.29.0.gfm.13.tar.gz \
@@ -46,25 +43,30 @@ RUN apk update \
COPY cgit/40-fcgiwrap.sh /docker-entrypoint.d/
RUN chmod +x /docker-entrypoint.d/40-fcgiwrap.sh
-COPY cgit/cgitrc /etc/
-
COPY cgit/nginx.conf /
RUN sed "s/\$DOMAIN/$DOMAIN/g" /nginx.conf > /etc/nginx/http.d/default.conf \
&& rm /nginx.conf
RUN addgroup nginx www-data
-COPY cgit/about.html /var/www/htdocs/cgit/
-COPY cgit/cgit.png /var/www/htdocs/cgit/logo.png
+COPY cgit/about.html /var/www/htdocs/cgit/
+COPY cgit/cgit.png /var/www/htdocs/cgit/logo.png
COPY cgit/favicon.ico /var/www/htdocs/cgit/
COPY cgit/css_variable_colors.sh /
+COPY cgit/update_syntax_style.py /
COPY cgit/everforest.css /var/www/htdocs/cgit/
-RUN sh css_variable_colors.sh
+RUN sh css_variable_colors.sh \
+ && python update_syntax_style.py zenburn > /var/www/htdocs/cgit/syntax.css \
+ && sed -i -Ee '/^sys\.stdout\.write.*style.*/d' /usr/local/lib/cgit/filters/syntax-highlighting.py
COPY cgit/about-formatting.sh /usr/local/lib/cgit/filters/about-formatting.sh
RUN chmod 755 /usr/local/lib/cgit/filters/about-formatting.sh
+# Lastly copy cgitrc, better to have it later so we don't invalidate the whole
+# build cache when iterating...
+COPY cgit/cgitrc /etc/
+
# Volume used to store SSH host keys, generated on first run
VOLUME /etc/ssh/keys
@@ -74,16 +76,8 @@ RUN rc-update add fail2ban \
&& rc-update add sshd
# www-data may not be necessary
-RUN addgroup fcgiwrap git
-#RUN usermod -G nginx,www-data,git nginx
-# Configure gitolite
-# Install OpenSSH server and Gitolite
-# Unlock the automatically-created git user
-
-#RUN addgroup -g 102 -S git \
-# && adduser -S -D -H -u 102 -h /var/lib/git -s /sbin/nologin -G git -g git git
-
-RUN git config --system advice.defaultBranchName false
+RUN addgroup fcgiwrap git \
+ && git config --system advice.defaultBranchName false
# Volume used to store all Gitolite data (keys, config and repositories), initialized on first run
VOLUME /var/lib/git