cedricfarinazzo / docker-nginx-git

Docker image for a Git HTTP server on Nginx.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

docker-nginx-git

Pulls

Docker image for a Git HTTP server on Nginx.

Installation

Download the image from the docker's hub:

docker pull emarcs/nginx-git

Usage

The simply run a container, remember to mount a volume from the host with all your repositories, in the example the host folder /git is mounted in the container at: /srv/git:

docker run -d -p 8180:80 -v /git:/srv/git emarcs/nginx-git

Docker Compose

Here's an example using Docker Compose:

test_srv:
  image: emarcs/nginx-git
  ports:
    - 8180:80
  volumes:
    - /srv/git:/srv/git
    - logs:/var/log/nginx
    # add your custom username and password (default is: admin, admin)
    - ./htpasswd:/srv/htpasswd
    # if you want to use a custom configuration
    - ./default.conf:/etc/nginx/conf.d/default.conf
  environment:
    GIT_POSTBUFFER: 1048576

Test it:

git clone http://localhost:8180/myrepo.git

Default username and password are admin/admin. I strongly suggest you to update the htpasswd file with your password, like so:

htpasswd htpasswd admin

About

Docker image for a Git HTTP server on Nginx.

License:MIT License


Languages

Language:Dockerfile 62.2%Language:Shell 21.7%Language:HTML 16.1%