├── Dockerfile ├── README.md ├── config.ini └── nginx.conf /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:14.04 2 | RUN apt-get update 3 | RUN apt-get -y install git nginx-full php5-fpm curl 4 | ADD https://s3.amazonaws.com/gitlist/gitlist-master.tar.gz /var/www/ 5 | RUN cd /var/www; tar -zxvf gitlist-master.tar.gz 6 | RUN chmod -R 777 /var/www/gitlist 7 | RUN cd /var/www/gitlist/; mkdir cache; chmod 777 cache 8 | WORKDIR /var/www/gitlist/ 9 | ADD config.ini /var/www/gitlist/ 10 | ADD nginx.conf /etc/ 11 | 12 | RUN mkdir -p /repos/sentinel 13 | RUN cd /repos/sentinel; git --bare init . 14 | 15 | CMD service php5-fpm restart; nginx -c /etc/nginx.conf 16 | 17 | 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | gitlist-docker 2 | ============== 3 | 4 | A ready to use docker image with preinstalled nginx and gitlist. 5 | 6 | You can use it to quickly expose a web interface of the git repositories in a 7 | directory of your host machine. 8 | 9 | The dockerfile uses the lastest gitlist-master.tar.gz distribution 10 | available. 11 | 12 | Usage 13 | ----- 14 | 15 | You can build the image like this 16 | 17 | git clone 18 | cd gitlist-docker 19 | docker build --rm=true -t gitlist . 20 | 21 | And run it like this 22 | 23 | docker run --rm=true -p 8888:80 -v /path/repo:/repos gitlist 24 | 25 | The web interface will be available on host machine at port 8888 and will show 26 | repositories inside /path/repo 27 | -------------------------------------------------------------------------------- /config.ini: -------------------------------------------------------------------------------- 1 | [git] 2 | client = '/usr/bin/git' ; Your git executable path 3 | default_branch = 'master' ; Default branch when HEAD is detached 4 | repositories[] = '/repos' ; Path to your repositories 5 | ; If you wish to add more repositories, just add a new line 6 | 7 | ; WINDOWS USERS 8 | ;client = '"C:\Program Files (x86)\Git\bin\git.exe"' ; Your git executable path 9 | ;repositories[] = 'C:\Path\to\Repos\' ; Path to your repositories 10 | 11 | ; You can hide repositories from GitList, just copy this for each repository you want to hide 12 | ; hidden[] = '/home/git/repositories/BetaTest' 13 | 14 | [app] 15 | debug = false 16 | cache = true 17 | 18 | ; If you need to specify custom filetypes for certain extensions, do this here 19 | [filetypes] 20 | ; extension = type 21 | ; dist = xml 22 | 23 | ; If you need to set file types as binary or not, do this here 24 | [binary_filetypes] 25 | ; extension = true 26 | ; svh = false 27 | ; map = true 28 | 29 | -------------------------------------------------------------------------------- /nginx.conf: -------------------------------------------------------------------------------- 1 | user www-data; 2 | daemon off; 3 | events { 4 | worker_connections 1024; 5 | } 6 | http { 7 | include /etc/nginx/mime.types; 8 | types_hash_max_size 2048; 9 | server_names_hash_bucket_size 64; 10 | server { 11 | listen 80; 12 | access_log /var/log/nginx/MYSERVER.access.log combined; 13 | error_log /var/log/nginx/MYSERVER.error.log error; 14 | 15 | root /var/www/gitlist; 16 | index index.php; 17 | 18 | # auth_basic "Restricted"; 19 | # auth_basic_user_file .htpasswd; 20 | 21 | location = /robots.txt { 22 | allow all; 23 | log_not_found off; 24 | access_log off; 25 | } 26 | 27 | location ~* ^/index.php.*$ { 28 | fastcgi_index index.php; 29 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 30 | 31 | # if you're using php5-fpm via tcp 32 | # fastcgi_pass 127.0.0.1:9000; 33 | 34 | # if you're using php5-fpm via socket 35 | fastcgi_pass unix:/var/run/php5-fpm.sock; 36 | 37 | include /etc/nginx/fastcgi_params; 38 | } 39 | 40 | location / { 41 | try_files $uri @gitlist; 42 | } 43 | 44 | location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { 45 | add_header Vary "Accept-Encoding"; 46 | expires max; 47 | try_files $uri @gitlist; 48 | tcp_nodelay off; 49 | tcp_nopush on; 50 | } 51 | 52 | # location ~* \.(git|svn|patch|htaccess|log|route|plist|inc|json|pl|po|sh|ini|sample|kdev4)$ { 53 | # deny all; 54 | # } 55 | 56 | location @gitlist { 57 | rewrite ^/.*$ /index.php; 58 | } 59 | } 60 | } 61 | --------------------------------------------------------------------------------