Skip to content

marcopompili/docker-nginx-cgit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

2d8a614 · Jan 21, 2021

History

39 Commits
Apr 17, 2016
Apr 17, 2016
Oct 17, 2019
Jan 21, 2021
Jan 12, 2021
Jan 12, 2021
Feb 8, 2018
Apr 17, 2016
Jan 12, 2021
Feb 19, 2019

Repository files navigation

docker-nginx-cgit

A Docker image for cGit running over Nginx.

Pulls

This is a docker image for cGit, a lightweight web interface for git.

Installation

Download this image from the docker hub:

docker pull emarcs/nginx-cgit

Then wait for docker to do its magic.

Usage

To launch the container, just the run command like this:

docker run -d \
  -p 2340:80 \
  --name nginx-git-srv \
  -v /git:/srv/git \
  emarcs/nginx-cgit

In the above example the /git folder of the the host is used inside the /srv/git folder of the container, the HTTP port is mapped on the host on port 2340.

Using a custom Nginx configuration

An example using docker-compose of how to mount a custom configuration for Nginx:

test_srv:
  image: emarcs/nginx-cgit
  ports:
    - 8181:80
  volumes:
    - /srv/git:/srv/git
    # custom nginx configuration
    - ./default.conf:/etc/nginx/sites-available/default
  environment:
    CGIT_TITLE: 'My awesome git repos'
    CGIT_DESC: 'Presented by Cgit on Docker'
    CGIT_VROOT: '/'
    # check section-from-path in cgit docs
    CGIT_SECTION_FROM_STARTPATH: 0
    CGIT_MAX_REPO_COUNT: 50

Cache

cGit provides a cache mechanism (cf https://git.zx2c4.com/cgit/tree/cgitrc.5.txt ), which will by default store entries in /var/cache/cgit.

You can eventually map this folder to your disk:

docker run -d \
  -p 2340:80 \
  --name nginx-git-srv \
  -v /git:/srv/git \
  -v /mnt/disk/cgit/cache:/var/cache/cgit \
  emarcs/nginx-cgit