Giter VIP home page Giter VIP logo

dokku-gitlab's Introduction

Dokku GitLab

Instructions for installing GitLab as a Dokku application, using the official GitLab CE Docker image.

Setup application

Create dokku application:

dokku apps:create gitlab

Create storage folders:

mkdir -p /home/storage/gitlab/data
mkdir -p /home/storage/gitlab/logs
mkdir -p /home/storage/gitlab/config

Mount storage folders:

dokku storage:mount gitlab /home/storage/gitlab/config:/etc/gitlab
dokku storage:mount gitlab /home/storage/gitlab/logs:/var/log/gitlab
dokku storage:mount gitlab /home/storage/gitlab/data:/var/opt/gitlab

Set proxy ports map and docker options:

dokku proxy:ports-set gitlab http:80:80
dokku docker-options:add gitlab deploy '-p 2222:22'

Edit configuration

Create gitlab.rb in /home/storage/gitlab/config and add the following settings:

# GitLab URL
##! URL on which GitLab will be reachable.
##! For more details on configuring external_url see:
##! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab
external_url 'https://gitlab.example.com'

##! **Override only if you use a reverse proxy**
##! Docs: https://docs.gitlab.com/omnibus/settings/nginx.html#setting-the-nginx-listen-port
nginx['listen_port'] = 80

##! **Override only if your reverse proxy internally communicates over HTTP**
##! Docs: https://docs.gitlab.com/omnibus/settings/nginx.html#supporting-proxied-ssl
nginx['listen_https'] = false

Deploy application

Clone this repository and push it to your dokku server:

git clone https://github.com/hardpixel/dokku-gitlab.git
cd dokku-gitlab

git remote add dokku [email protected]:gitlab
git push dokku master

Enable SSL

Generate LetsEncrypt certificates:

dokku letsencrypt gitlab

Configure GIT

Update ssh config, located at ~/.ssh/config, on your local machine:

Host gitlab.example.com
    Port 2222

Reconfigure GitLab

Connect to the gitlab app container:

dokku enter gitlab
gitlab-ctl reconfigure

Or run the command from outside the app container:

dokku run gitlab gitlab-ctl reconfigure

Update GitLab

Before updating you have to stop the running container or the update will fail.

dokku ps:stop gitlab
docker pull gitlab/gitlab-ce
dokku ps:rebuild gitlab

dokku-gitlab's People

Contributors

jonian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dokku-gitlab's Issues

Little issue in the doc

In the install procedure you said to :
Create gitlab.rb in /home/storage/gitlab/data
However it should be in /home/storage/gitlab/config because /home/storage/gitlab/config is mounted in /etc/gitlab of the container.

Container Registry

Hello,

Do you have any idea how to create a container registry with dokku-gitlab.

I've tried several things but none is working great.
I've tried adding the following settings in /etc/gitlab/gitlab.rb:

1

registry_external_url 'http://gitlab.registry.<domain>.com'
registry['enable'] = true

Added the domain in dokku and add the certificate with letsencrypt for this new domain.
When I do a docker push it start to work for a 0.1s then it show me the following error. (also the image container name is created in gitlab but is empty as it didn't finish to push)

 error parsing HTTP 400 response body: invalid character '<' looking for beginning of value: "<html>\r\n<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>400 Bad Request</h1></center>\r\n<center>The plain HTTP request was sent to HTTPS port</center>\r\n<hr><center>nginx</center>\r\n</body>\r\n</html>\r\n"

2

registry_external_url 'http://gitlab.<domain>.com:5050' # same url as gitlab with an explicit port
registry['enable'] = true

However it does not work because it try to connect to <host_ip>:5050 and bypass dokku/gitlab container

3

Almost like 1st one but with https

registry_external_url 'https://gitlab.registry.<domain>.com'
registry['enable'] = true

after reconfigure gitlab frontpage was showing the basic nginx/dokku error. In the container logs it said :

==> /var/log/gitlab/nginx/error.log <==
2021/06/21 15:12:04 [emerg] 13232#0: cannot load certificate key "/etc/gitlab/ssl/gitlab.registry.<domain>.com.key": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/gitlab/ssl/gitlab.registry.<domain>.com.key','r') error:2006D080:BIO routines:BIO_new_file:no such file)

So I added the dokku certificate content manually from dokku certs:show gitlab key into /etc/gitlab/ssl/gitlab.registry.<domain>.com.key
And dokku certs:show gitlab crt into /etc/gitlab/ssl/gitlab.registry.<domain>.com.crt

However now on docker push I got 404 and indeed the url https://gitlab.registry.domain.com is now redirecting me to the regular gitlab frontpage instead of the registry.

\
\
\

The thing that seems to work the most is the first solution as it seems to at least create something in the container registry.
However i didn't find a solution for this http<->https error maybe a config with dokku, maybe with gitlab.rb ...

Do you have by any chance an idea on how to make it work ?
Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.