summaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
authorJesper Jensen <jesper@jnsn.dev>2026-04-24 23:36:52 +0200
committerJesper Jensen <jesper@jnsn.dev>2026-06-04 19:39:17 +0200
commitac89b3c715fd3eddca7898e069ee04498c1a1ba2 (patch)
treeeb0294e645dd494ebe2b222292e6f8463d936277 /Dockerfile
INITIAL COMMIT
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile45
1 files changed, 45 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..d92efca
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,45 @@
+FROM alpine:3.22.4
+
+RUN apk add --no-cache \
+ cgit \
+ git \
+ git-daemon \
+ lighttpd \
+ lighttpd-mod_auth \
+ openssh-server \
+ tini
+
+RUN addgroup -g 1000 -S git \
+ && adduser -u 1000 -S -D -G git -h /var/lib/git -s /usr/bin/git-shell git \
+ && adduser git tty\
+ && passwd -u git \
+ && mkdir -p \
+ /etc/git-host/secrets \
+ /usr/local/libexec \
+ /var/lib/git \
+ /run/git-host/secrets \
+ /run/lighttpd \
+ /run/sshd \
+ /var/tmp/lighttpd \
+ /var/www/localhost/htdocs \
+ && chown -R git:git /var/lib/git
+
+COPY entrypoint.sh /usr/local/bin/entrypoint.sh
+COPY git-http-backend.cgi /usr/local/libexec/git-http-backend.cgi
+COPY create-repo.sh /usr/local/bin/create-repo
+COPY sshd_config /etc/ssh/sshd_config
+COPY cgitrc /etc/cgitrc
+COPY lighttpd.conf /etc/lighttpd/lighttpd.conf
+COPY auth.conf /etc/lighttpd/auth.conf
+COPY healthz /var/www/localhost/htdocs/healthz
+
+RUN chmod 0755 /usr/local/bin/entrypoint.sh /usr/local/libexec/git-http-backend.cgi /usr/local/bin/create-repo \
+ && chown git:git /var/lib/git /run/lighttpd /var/tmp/lighttpd /var/www/localhost/htdocs \
+ && chmod 0755 /run/git-host /run/git-host/secrets \
+ && grep -q "^git:" /etc/passwd \
+ && lighttpd -tt -f /etc/lighttpd/lighttpd.conf
+
+EXPOSE 8080 2222
+VOLUME ["/var/lib/git"]
+
+ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/entrypoint.sh"]