项目作者: hardpixel

项目描述 :
Run official GitLab docker image on Dokku PaaS
高级语言: Dockerfile
项目地址: git://github.com/hardpixel/dokku-gitlab.git
创建时间: 2019-08-31T22:41:55Z
项目社区:https://github.com/hardpixel/dokku-gitlab

开源协议:

下载


Dokku GitLab

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

Setup application

Create dokku application:

  1. dokku apps:create gitlab

Create storage folders:

  1. mkdir -p /home/storage/gitlab/data
  2. mkdir -p /home/storage/gitlab/logs
  3. mkdir -p /home/storage/gitlab/config

Mount storage folders:

  1. dokku storage:mount gitlab /home/storage/gitlab/config:/etc/gitlab
  2. dokku storage:mount gitlab /home/storage/gitlab/logs:/var/log/gitlab
  3. dokku storage:mount gitlab /home/storage/gitlab/data:/var/opt/gitlab

Set proxy ports map and docker options:

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

Edit configuration

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

  1. # GitLab URL
  2. ##! URL on which GitLab will be reachable.
  3. ##! For more details on configuring external_url see:
  4. ##! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab
  5. external_url 'https://gitlab.example.com'
  6. ##! **Override only if you use a reverse proxy**
  7. ##! Docs: https://docs.gitlab.com/omnibus/settings/nginx.html#setting-the-nginx-listen-port
  8. nginx['listen_port'] = 80
  9. ##! **Override only if your reverse proxy internally communicates over HTTP**
  10. ##! Docs: https://docs.gitlab.com/omnibus/settings/nginx.html#supporting-proxied-ssl
  11. nginx['listen_https'] = false

Deploy application

Clone this repository and push it to your dokku server:

  1. git clone https://github.com/hardpixel/dokku-gitlab.git
  2. cd dokku-gitlab
  3. git remote add dokku dokku@example.com:gitlab
  4. git push dokku master

Enable SSL

Generate LetsEncrypt certificates:

  1. dokku letsencrypt gitlab

Configure GIT

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

  1. Host gitlab.example.com
  2. Port 2222

Reconfigure GitLab

Connect to the gitlab app container:

  1. dokku enter gitlab
  2. gitlab-ctl reconfigure

Or run the command from outside the app container:

  1. dokku run gitlab gitlab-ctl reconfigure

Update GitLab

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

  1. dokku ps:stop gitlab
  2. docker pull gitlab/gitlab-ce
  3. dokku ps:rebuild gitlab