比如 xxxx.org,如果开启邮件功能,可以选择腾讯云的企业邮箱,建立专属自己的邮件名称
docker pull gitlab/gitlab-ce
docker run --detach \
--hostname gitlab.xxxx.org \
--publish 22443:443 --publish 8083:80 --publish 2222:22 \
--name gitlab \
--memory 4g \
--restart always \
--volume ~/dockerfile/gitlab/config:/etc/gitlab \
--volume ~/dockerfile/gitlab/logs:/var/log/gitlab \
--volume ~/dockerfile/gitlab/data:/var/opt/gitlab \
gitlab/gitlab-ce:latest
docker exec -it gitlab bash
gitlab-ctl reconfigure
添加外部请求的域名(如果不支持https, 可以改成http)
external_url 'http://gitlab.xxxx.org'
# 修改gitlab对应的时区
gitlab_rails['time_zone'] = 'PRC'
# 开启邮件支持
gitlab_rails['gitlab_email_enabled'] = true
gitlab_rails['gitlab_email_from'] = 'gitlab@xxxx.org'
gitlab_rails['gitlab_email_display_name'] = 'xxxx GitLab'
# 配置邮件参数
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.exmail.qq.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "gitlab@xxxx.org"
gitlab_rails['smtp_password'] = "xx"
gitlab_rails['smtp_domain'] = "smtp.qq.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true
user['git_user_email'] = "gitlab@xxxx.org"
gitlab-ctl reconfigure
gitlab-ctl restart
# Pull image from Docker Hub.
$ docker pull gogs/gogs
# Create local directory for volume.
$ mkdir -p /var/gogs
# Use `docker run` for the first time.
$ sudo docker run --detach --name=gogs -p 10022:22 -p 10080:3000 -v ~/dockerfile/gogs/data/:/data gogs/gogs
# Use `docker start` if you have stopped it.
$ docker start gogs
server {
listen 443 ssl;
server_name gogs.xxxx.org;
ssl_certificate ~/Nginx/1_gogs.xxxx.org_bundle.crt;
ssl_certificate_key ~/Nginx/2_gogs.xxxx.org.key;
server_tokens off;
location /{
proxy_pass http://127.0.0.1:10080/;
proxy_redirect default;
}
}
server {
listen 80;
server_name gogs.xxxx.org;
return 301 https://$host$request_uri;
}
sudo nginx -s reload
sudo service nginx stop
sudo service nginx start
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。