docker部署单机gitlab
docker run --detach --publish 8443:443 --publish 8090:80 --name gitlab --restart always --hostname 192.168.197.131 -v /home/software/gitlab/etc:/etc/gitlab -v /home/software/gitlab/logs:/var/log/gitlab -v /home/software/gitlab/data:/var/opt/gitlab -v /etc/localtime:/etc/localtime:ro --privileged=true docker.io/beginor/gitlab-ce
主要把redis,postgresql,gitlab的配置文件映射出来,把数据跟日志也映射到宿主机
配置gitlab发送邮件,修改gitlab.rb
修改如下:
### Email Settings gitlab_rails['gitlab_email_enabled'] = true gitlab_rails['gitlab_email_from'] = 'qq邮箱' gitlab_rails['gitlab_email_display_name'] = '发件人名字' gitlab_rails['gitlab_email_reply_to'] = 'qq邮箱与上面对应一样' gitlab_rails['gitlab_email_subject_suffix'] = ''
### GitLab email server settings ###! Docs: https://docs.gitlab.com/omnibus/settings/smtp.html ###! **Use smtp instead of sendmail/postfix.** gitlab_rails['smtp_enable'] = true gitlab_rails['smtp_address'] = "smtp.qq.com" gitlab_rails['smtp_port'] = 25 gitlab_rails['smtp_user_name'] = "qq邮箱" gitlab_rails['smtp_password'] = "qq邮箱的客户端授权码" gitlab_rails['smtp_domain'] = "smtp.qq.com" gitlab_rails['smtp_authentication'] = "login" gitlab_rails['smtp_enable_starttls_auto'] = true gitlab_rails['smtp_tls'] = false gitlab_rails['smtp_openssl_verify_mode'] = 'none'
执行:gitlab-ctl reconfigure
执行:gitlab-ctl restart
参考:https://docs.gitlab.com/omnibus/settings/smtp.html
测试邮件发送:https://blog.csdn.net/xiazichenxi/article/details/90233332