summaryrefslogtreecommitdiff
path: root/images/git/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'images/git/Dockerfile')
-rw-r--r--images/git/Dockerfile35
1 files changed, 35 insertions, 0 deletions
diff --git a/images/git/Dockerfile b/images/git/Dockerfile
new file mode 100644
index 0000000..bd8589e
--- /dev/null
+++ b/images/git/Dockerfile
@@ -0,0 +1,35 @@
+FROM alpine:3.5 AS builder
+
+RUN apk add --no-cache sassc
+
+ADD cgit/cgit.sass /app/
+RUN sassc -t compressed /app/cgit.sass /app/cgit.css
+
+FROM server_runit AS final
+
+RUN apk add --no-cache sudo shadow \
+ git gitolite git-daemon \
+ openssh openssh-client \
+ cgit highlight markdown \
+ nginx spawn-fcgi fcgiwrap
+
+# gitolite
+RUN mkdir -p /data /data/log
+RUN echo 'git:*' | chpasswd
+RUN usermod --home /data/git --move-home git
+
+ADD gitolite/ /app/
+RUN ln -s /app/gitolite.rc /data/git/.gitolite.rc
+RUN chown -R git:git /app/gitolite.rc /data/log /data/git
+RUN sudo -u git GL_LOGFILE=/data/log/gitolite gitolite setup -pk /app/admin.pub
+
+ADD gitolite/sshd_config /etc/ssh/
+ADD gitolite/generate_certs.sh /app/
+
+# cgit
+ADD cgit/cgitrc /etc/
+ADD cgit/syntax-highlighting3.sh /app/
+ADD cgit/about-formatting.sh /app/
+COPY --from=builder /app/cgit.css /usr/share/webapps/cgit/cgit.css
+
+ADD nginx/nginx.conf /etc/nginx/nginx.conf