aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Caddyfile14
-rw-r--r--Dockerfile7
-rw-r--r--README.md20
-rw-r--r--cgitrc11
-rw-r--r--supervisord.conf14
5 files changed, 66 insertions, 0 deletions
diff --git a/Caddyfile b/Caddyfile
new file mode 100644
index 0000000..125cf2b
--- /dev/null
+++ b/Caddyfile
@@ -0,0 +1,14 @@
+{$SITE_ADDRESS:localhost}
+
+@assets path /cgit.css /cgit.js /cgit.png /favicon.ico /robots.txt
+handle @assets {
+ root * /usr/share/webapps/cgit
+ file_server
+}
+
+reverse_proxy unix//var/run/fgciwrap.sock {
+ transport fastcgi {
+ env SCRIPT_FILENAME /usr/share/webapps/cgit/cgit.cgi
+ }
+}
+
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..0316d5d
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,7 @@
+FROM alpine
+WORKDIR /root
+COPY Caddyfile .
+COPY supervisord.conf .
+COPY cgitrc /etc/
+RUN apk add --no-cache cgit git caddy fcgiwrap supervisor py3-markdown py3-pygments
+ENTRYPOINT supervisord -c supervisord.conf
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..8ca3065
--- /dev/null
+++ b/README.md
@@ -0,0 +1,20 @@
+# My cgit docker container
+
+## Usage
+
+### Docker compose
+
+Bind mount your git repos to `/repos` and a data folder to `/root/.local/share/caddy`.
+The only environment variable is `SITE_ADDRESS`. If unset then localhost will be used (which you can't really use since the certs are inside the container).
+
+ services:
+ cgit:
+ build: ./cgit
+ ports:
+ - "443:443"
+ - "80:80"
+ volumes:
+ - ~/repos:/repos
+ - ./data:/root/.local/share/caddy
+ environment:
+ SITE_ADDRESS: git.soltermann.xyz
diff --git a/cgitrc b/cgitrc
new file mode 100644
index 0000000..b35d83c
--- /dev/null
+++ b/cgitrc
@@ -0,0 +1,11 @@
+# Highlight source code with python pygments-based highlighter
+source-filter=/usr/lib/cgit/filters/syntax-highlighting.py
+
+# Format markdown, restructuredtext, manpages, text files, and html files
+# through the right converters
+about-filter=/usr/lib/cgit/filters/about-formatting.sh
+
+remove-suffix=1
+
+readme=:README.md
+scan-path=/repos
diff --git a/supervisord.conf b/supervisord.conf
new file mode 100644
index 0000000..953aa5e
--- /dev/null
+++ b/supervisord.conf
@@ -0,0 +1,14 @@
+[supervisord]
+loglevel=debug
+nodaemon=true
+user=root
+
+[program:caddy]
+command=caddy run --config /root/Caddyfile
+stdout_logfile=/dev/stdout
+stdout_logfile_maxbytes=0
+
+[program:git_frontend]
+command=fcgiwrap -s unix:/var/run/fgciwrap.sock
+stdout_logfile=/dev/stdout
+stdout_logfile_maxbytes=0