--- /dev/null
+FROM nginx:1.27-alpine
+
+RUN apk add --no-cache git git-gitweb fcgiwrap perl-cgi
+
+RUN mkdir -p /srv/git
+RUN git config --global --add safe.directory "/srv/git/*"
+
+EXPOSE 9000
+CMD ["-s", "tcp:0.0.0.0:9000", "-f"]
+ENTRYPOINT ["fcgiwrap"]
--- /dev/null
+# requires variable config loading, such as:
+# docker stack deploy -c <(docker-compose config) proxy
+
+version: '3'
+services:
+ web:
+ build: web
+ image: cjpalmer/gitweb:0.1.0
+ volumes:
+ - /srv/git:/srv/git:ro
+ - ./gitweb.conf:/etc/gitweb.conf
+ ports:
+ - 80:80
+ cgi:
+ build: cgi
+ image: cjpalmer/gitweb-cgi:0.1.0
+ volumes:
+ - /srv/git:/srv/git:ro
+ - ./gitweb.conf:/etc/gitweb.conf
--- /dev/null
+# path to git projects (<project>.git)
+$projectroot = "/srv/git";
+
+# directory to use for temp files
+$git_temp = "/tmp";
+
+# target of the home link on top of all pages
+$home_link = $my_uri || "/";
+
+# html text to include at home page
+$home_text = "indextext.html";
+
+# file with project list; by default, simply scan the projectroot dir.
+$projects_list = $projectroot;
+
+# stylesheet to use
+@stylesheets = ("static/gitweb.css");
+
+# javascript code for gitweb
+$javascript = "static/gitweb.js";
+
+# logo to use
+$logo = "static/git-logo.png";
+
+# the 'favicon'
+$favicon = "static/git-favicon.png";
+
+# git-diff-tree(1) options to use for generated patches
+#@diff_opts = ("-M");
+@diff_opts = ();
--- /dev/null
+FROM nginx:1.27-alpine
+
+RUN apk add --no-cache git git-gitweb fcgiwrap
+
+RUN mkdir -p /srv/git
+RUN git config --global --add safe.directory "/srv/git/*"
+
+COPY default.conf /etc/nginx/conf.d/
--- /dev/null
+server {
+ listen 80;
+ root /usr/share/gitweb;
+
+ location /static {
+ sendfile on;
+ tcp_nopush on;
+ }
+ location / {
+ fastcgi_pass cgi:9000;
+ fastcgi_param SCRIPT_FILENAME /usr/share/gitweb/gitweb.cgi;
+ fastcgi_param PATH_INFO $uri;
+ fastcgi_param GITWEB_CONFIG /etc/gitweb.conf;
+ include fastcgi_params;
+ }
+}