I’ve set up a NUC in the house to replace a Digital Ocean droplet.
My first job was to set up a headless Fedora 26 server. Currently it’s running Nextcloud which I set up using instructions from: marksei.com, and a docker container with Gitlab on it, based on instructions from this site.
To get the docker container to run I sued the following code:
docker run --detach --hostname gitlab.my.domain --publish 1443:443 --publish 180:80 --publish 122:22 --name gitlab --restart always --volume /srv/gitlab/config:/etc/gitlab:Z --volume /srv/gitlab/logs:/var/log/gitlab:Z --volume /srv/gitlab/data:/var/opt/gitlab:Z gitlab/gitlab-ce:latest
Notice that the ports are translated to:
1443 from 443 (https)
180 from 80 (http)
122 from 22 (ssh)
…because I was already running https, http and ssh on the server.
mark the repo as the origin by going into the directory and using the following command for SSH
git remote add origin ssh://git@yourIPADDRESSorURL:122/monkeymike/MyGreatCodingProject.git
..or for http connections (using username and password – when pushing)
git remote add origin http://yourIPADDRESSorURL:180/monkeymike/MyGreatCodingProject.git
then push to it with:
git push -u origin --all
…and if you need to clear this:
git remote rm origin
If I want to connect to the docker container over SSH I use:
ssh git@myserverURL -p 122
..and when I connect to the server, front end, I use http://myserverURL:180 and it’s all good.