|
再装一个GitLab-ce
如果你是懒人(我一直认为懒一定程度上推动了人类进步~),直接打开楼上安装的portainer -> App Templates -> gitlab-ce 输入名称,deploy就完事了
下面命令行安装
=============================
sudo docker pull gitlab/gitlab-ce
=============================
创建数据文件夹
=============================
sudo mkdir -p /data/gitlab/config
sudo mkdir -p /data/gitlab/logs
sudo mkdir -p /data/gitlab/data
GITLAB_HOME=/data/gitlab
=============================
运行容器
=======================================
sudo docker run --detach \
--hostname gitlab.example.com \
--publish 443:443 --publish 80:80 --publish 22:22 \
--name gitlab \
--restart always \
--volume $GITLAB_HOME/config:/etc/gitlab \
--volume $GITLAB_HOME/logs:/var/log/gitlab \
--volume $GITLAB_HOME/data:/var/opt/gitlab \
gitlab/gitlab-ee:latest
=======================================
如果443,80,22这三个端口被占用,nginx反向代理即可
=======================================
sudo docker run --detach \
--hostname gitlab.example.com \
--publish 8443:443 --publish 880:80 --publish 822:22 \
--name gitlab \
--restart always \
--volume $GITLAB_HOME/config:/etc/gitlab \
--volume $GITLAB_HOME/logs:/var/log/gitlab \
--volume $GITLAB_HOME/data:/var/opt/gitlab \
gitlab/gitlab-ee:latest
=======================================
=======================================
vim /etc/nginx/conf.d/gitlab.conf
# 内容如下
server {
listen 80;
server_name 你的域名;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://127.0.0.1:880;
}
}
server {
listen 443 ssl;
server_name 你的域名;
ssl_certificate 你的SSL证书;
ssl_certificate_key 你的SSL证书;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://127.0.0.1:8443;
}
}
# 重启nginx
sudo systemctl restart nginx
=======================================
|
|