aboutsummaryrefslogtreecommitdiff
path: root/gitolite/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'gitolite/Dockerfile')
-rw-r--r--gitolite/Dockerfile30
1 files changed, 30 insertions, 0 deletions
diff --git a/gitolite/Dockerfile b/gitolite/Dockerfile
new file mode 100644
index 0000000..f6749f7
--- /dev/null
+++ b/gitolite/Dockerfile
@@ -0,0 +1,30 @@
+FROM alpine:3.23.3
+
+# Install OpenSSH server and Gitolite
+# Unlock the automatically-created git user
+RUN set -x \
+ && apk add --no-cache openrc fail2ban gitolite openssh
+
+RUN apk update && apk update
+
+RUN rc-update add fail2ban
+
+RUN git config --system advice.defaultBranchName false
+
+# Volume used to store SSH host keys, generated on first run
+VOLUME /etc/ssh/keys
+
+# Volume used to store all Gitolite data (keys, config and repositories), initialized on first run
+VOLUME /var/lib/git
+
+# Entrypoint responsible for SSH host keys generation, and Gitolite data initialization
+COPY docker-entrypoint.sh /
+RUN chmod +x /docker-entrypoint.sh
+ENTRYPOINT ["/docker-entrypoint.sh"]
+
+# Expose port 22 to access SSH
+EXPOSE 22
+
+# Default command is to run the SSH server
+
+CMD ["sshd"]