Docker 安装配置 GitLab

一、安装GitLab

docker run -d 
    -h git.test.com
    -p 80:80 
    -p 443:443 
    -p 22:22
    -v /www/wwwroot/git.test.com/gitlab/config:/etc/gitlab:rw
    -v /www/wwwroot/git.test.com/gitlab/data:/var/opt/gitlab:rw
    -v /www/wwwroot/git.test.com/gitlab/logs:/var/log/gitlab:rw
    -v /www/server/panel/vhost/cert/git.test.com:/gitlab_ssl:ro
    --restart=always --name server-gitlab gitlab/gitlab-ce:latest

二、GitLab启用SSL

  • 进入容器
docker exec -it server-gitlab /bin/bash
  • 修改配置文件:vim /etc/gitlab/gitlab.rb
external_url "https://git.test.com"    
nginx['enable'] = true
nginx['redirect_http_to_https'] = true  
nginx['ssl_certificate'] = "/gitlab_ssl/fullchain.pem"
nginx['ssl_certificate_key'] = "/gitlab_ssl/privkey.pem"

三、GITLab配置SMTP服务器

  • 配置邮件服务器
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.163.com"
gitlab_rails['smtp_port'] = 465 
gitlab_rails['smtp_user_name'] = "xxuser@163.com"
gitlab_rails['smtp_password'] = "xxpassword"
gitlab_rails['smtp_domain'] = "163.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
  • 配置发信人
gitlab_rails['gitlab_email_from'] = "xxuser@163.com"
user["git_user_email"] = "xxuser@163.com"

四、重新生成配置并重启GitLab

# 重新生成配置
gitlab-ctl reconfigure
# 重启GitLab
gitlab-ctl restart

 原文:https://www.xqitw.cn/docker-gitlab.html

这不是一个 BUG,这只是一个未列出来的特性!

itxq
讨论数量: 0
(= ̄ω ̄=)··· 暂无内容!

请勿发布不友善或者负能量的内容。与人为善,比聪明更重要!