Open joephon opened 4 years ago
docker
cerbot
nginx
sudo apt-get install docker
sudo docker -v // => Docker version 18.09.2, build 6247962 | or your version
sudo docker pull gitlab/gitlab-ce:latest
sudo docker run --name='gitlab' -d \ --publish 3443:443 --publish 3080:80 --publish 3022:22 \ --restart always \ --volume /srv/gitlab/config:/etc/gitlab \ --volume /srv/gitlab/logs:/var/log/gitlab \ --volume /srv/gitlab/data:/var/opt/gitlab \ --privileged=true \ gitlab/gitlab-ce:latest
sudo docker ps // => (health: starting) | or (healthy)
sudo apt-get install -y nginx
sudo apt-get install certbot python-certbot-nginx
sudo vim /etc/nginx/sites-enabled/gitlab.conf // /etc/nginx/sites-enabled/gitlab.conf server { server_name example.com; location / { # try_files $uri $uri/ =404; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://localhost:3080; client_max_body_size 100m; } }
sudo nginx -s reload
sudo certbot --nginx // => Congratulations! Your certificate and chain have been saved
go to visit your self-hosted gitlab server via whatever browser
Dependencies
docker
cerbot
nginx
OS
Step 1 install docker
Step 2 test docker
Step 3 pull gitlab image
Step 4 run gitlab image
Step 5 test gitlab
Step 6 install nginx
Step 7 install certbot
Step 8 config nginx
Step 9 reload nginx
Step 10 register https
Bingo!
go to visit your self-hosted gitlab server via whatever browser
这篇文价值一块钱