~saiko/docker-cgit

bf5ec108186a056821b14add178924fda429d2f7 — therealfarfetchd 1 year, 15 days ago
Initial commit
4 files changed, 131 insertions(+), 0 deletions(-)

A build/fcgi/Dockerfile
A data/cgitrc
A data/conf/default.conf
A docker-compose.yml
A  => build/fcgi/Dockerfile +7 -0
@@ 1,7 @@
FROM alpine:edge

RUN \
  apk upgrade --no-cache && \
  apk add --no-cache cgit git fcgiwrap py3-pygments py3-markdown py3-docutils

ENTRYPOINT /usr/bin/fcgiwrap -s tcp:0.0.0.0:9000

A  => data/cgitrc +76 -0
@@ 1,76 @@
#
# cgit config
#

css=/cgit.css
logo=/cgit.png

root-title=therealfarfetchd's git repository
root-desc=you want source code, you get source code

# Allow http transport git clone
enable-http-clone=1
clone-url=git@git.therealfarfetchd.dev:$CGIT_REPO_URL https://$HTTP_HOST/$CGIT_REPO_URL

# if you do not want that webcrawler (like google) index your site
robots=noindex, nofollow

# if cgit messes up links, use a virtual-root. For example, cgit.example.org/ has this value:
virtual-root=/

enable-git-config=1
snapshots=tar.xz zip

enable-commit-graph=1
enable-index-links=1
enable-log-filecount=1
enable-log-linecount=1
case-sensitive-sort=0

repository-sort=age
branch-sort=age

max-stats=quarter

source-filter=/usr/lib/cgit/filters/syntax-highlighting.py
about-filter=/usr/lib/cgit/filters/about-formatting.sh

mimetype.gif=image/gif
mimetype.html=text/html
mimetype.jpg=image/jpeg
mimetype.jpeg=image/jpeg
mimetype.pdf=application/pdf
mimetype.png=image/png
mimetype.svg=image/svg+xml
mimetype-file=/etc/mime.types

readme=:README.md
readme=:readme.md
readme=:README.mkd
readme=:readme.mkd
readme=:README.rst
readme=:readme.rst
readme=:README.html
readme=:readme.html
readme=:README.htm
readme=:readme.htm
readme=:README.txt
readme=:readme.txt
readme=:README
readme=:readme
readme=:INSTALL.md
readme=:install.md
readme=:INSTALL.mkd
readme=:install.mkd
readme=:INSTALL.rst
readme=:install.rst
readme=:INSTALL.html
readme=:install.html
readme=:INSTALL.htm
readme=:install.htm
readme=:INSTALL.txt
readme=:install.txt
readme=:INSTALL
readme=:install

scan-path=/srv/git

A  => data/conf/default.conf +15 -0
@@ 1,15 @@
server {
    listen 80;
    server_name git.therealfarfetchd.dev;
    root /usr/share/webapps/cgit;
    try_files $uri @cgit;

    location @cgit {
        include fastcgi_params;
        fastcgi_param       SCRIPT_FILENAME $document_root/cgit.cgi;
        fastcgi_param       PATH_INFO       $uri;
        fastcgi_param       QUERY_STRING    $args;
        fastcgi_param       HTTP_HOST       $server_name;
        fastcgi_pass fcgi:9000;
    }
}

A  => docker-compose.yml +33 -0
@@ 1,33 @@
version: '3'
services:
  web:
    image: nginx
    volumes:
      - ./data/conf:/etc/nginx/conf.d
      - cgit:/usr/share/webapps/cgit
    networks:
      internal:
      export-http:
        aliases:
          - cgit
    restart: unless-stopped
    depends_on:
      - fcgi
  fcgi:
    build: ./build/fcgi
    volumes:
      - ./data/cgit:/etc/cgit
      - ./data/cgitrc:/etc/cgitrc
      - /home/git:/srv/git
      - cgit:/usr/share/webapps/cgit
    networks:
      internal:
        aliases:
          - fcgi
    restart: unless-stopped
networks:
  internal:
  export-http:
    external: true
volumes:
  cgit: