Skip to content

webdevisme/docker-gogs-mysql

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Gogs MySQL Build Status GitHub version

Gogs is a painless self-hosted Git service

NOTE/Disclaimer: This is a fork of the awesome repo (that made things much easier for me!) however, I found that as I'd setup nginx on my server with subdomain redirect (gogs.mydomain.com) that the install scripts on this repo didn't quite set things up correctly for me, as it was designed to work with a domain:port address.

Checkout the bottom of this readme for an example nginx config.

Getting started

  1. Clone project :

    git clone https://github.com/nanoninja/docker-gogs-mysql.git
  2. You could customize your settings before installation :

    Edit .env file and etc/app.ini.dist

  3. Install :

    use Makefile

    # show commands
    make help
    
    sudo make install

    or by entering the following commands

    # Copy the configuration file from the dist file
    cp etc/app.ini.dist etc/app.ini
    
    # Start services
    sudo docker-compose up -d
    
    # Generate self-signed certificates
    source .env && sudo docker-compose exec -T gogsapp bash -c "cd /app/gogs; exec /app/gogs/gogs cert -ca=true -duration=$GOGS_CERT_DURATION -host=$GOGS_HTTP_DOMAIN"
    
    # Copy the configuration file to the container
    sudo docker cp $(pwd)/etc/app.ini $(sudo docker-compose ps -q gogsapp):/data/gogs/conf/app.ini
    
    # Restart the server to reload the configuration
    sudo docker-compose restart gogsapp
    
    # Automatic form filling with cURL
    sudo docker run --env-file $(pwd)/.env --rm -v $(pwd)/bin/install.sh:/install.sh --net=host appropriate/curl /bin/sh /install.sh
  4. Open your favorite browser :


Using Git with SSH

Configure Git to trust a self-signed certificate

Local

git -c http.sslVerify=false push origin master

Global

git config --global http.sslVerify false

Unset Global

git config --global --unset http.sslVerify

Example Nginx Config

This is using SSL setup using certbot

server {
    listen 443 ssl;
    server_name gogs.mydomain.com;
    location / {
            proxy_pass https://mydomain.com:10080;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_connect_timeout 150;
            proxy_send_timeout 100;
            proxy_read_timeout 100;
            proxy_buffers 4 32k;
            client_max_body_size 8m;
            client_body_buffer_size 128k;

    }

    ssl_certificate /etc/letsencrypt/live/gogs.mydomain.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/gogs.mydomain.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}

Images to use

About

Gogs installer with Docker

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 63.7%
  • Makefile 36.3%