nginx代理docker的gitlab
步骤:
docker run -d --hostname gitlab.xxx.com --publish 3000:80 --name gitlab --restart always --volume /usr/local/gitlab/config:/etc/gitlab -v /usr/local/gitlab/logs:/var/log/gitlab -v /usr/local/gitlab/data:/var/opt/gitlab -v /usr/local/gitlab/gitlab.rb:/etc/gitlab/gitlab.rb gitlab/gitlab-ce:9.5.5-ce.0
cat /usr/local/gitlab/gitlab.rb
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.exmail.qq.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "gitlab@xxx.com"
gitlab_rails['smtp_password'] = "xxx"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true
gitlab_rails['gitlab_email_from'] = 'gitlab@xxx.com'
external_url "http://gitlab.xxx.com"
nginx
upstream gitlab.xxx.com {
server 127.0.0.1:3000;
}
server {
listen 80;
server_name gitlab.xxx.com;
location / {
proxy_pass http://gitlab.xxx.com;
}
}