Install GitLab using Docker Compose
1. Install Docker Compose
# 1. remove installed & install dependency
sudo apt remove docker-desktop
sudo rm -r $HOME/.docker/desktop
sudo rm /usr/local/bin/com.docker.cli
sudo apt purge docker-desktop
sudo apt install gnome-terminal
# 2. setup the repository
sudo apt-get update
sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release
sudo
mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# 3. Install Docker
sudo apt-get update
sudo apt-get install docker-compose-plugin
2. Install GitLab
## 1. Preparation # Go to the targeted folder
vi .env # set GITLAB_HOME in .env GITLAB_HOME=/mnt/data/Applications/gitlab vi docker-compose.yml # docker-compose.yml version: '3.6' services: web: image: 'gitlab/gitlab-ee:latest' restart: always hostname: 'gitlab.example.com'
cd /mnt/data/Applications/gitlab vi /etc/hosts # private domain to IP 127.0.0.1 gitlab.example.com
environment: GITLAB_OMNIBUS_CONFIG: | external_url 'http://gitlab.example.com:1080'
gitlab_rails['gitlab_shell_ssh_port'] = 1022 # Add any other gitlab.rb configuration here, each on its own line ports: - '1080:1080' - '443:443' - '1022:22' volumes: - '$GITLAB_HOME/:/mnt/data/Applications/gitlab' - '$GITLAB_HOME/config:/mnt/data/Applications/gitlab/config' - '$GITLAB_HOME/logs:/mnt/data/Applications/gitlab/logs' - '$GITLAB_HOME/data:/mnt/data/Applications/gitlab/data' shm_size: '256m' ## 2. docker compose installation sudo docker --env-file .env up -d # 3. get password for root sudo docker exec -it gitlab-web-1 grep 'Password:' /etc/gitlab/initial_root_password ## 4. Browsing GitLab ## http://gitlab.example.com:1080
## or ## 192.168.0.xxx:1080
# reconfiguration sudo docker exec -it gitlab-web-1 editor /etc/gitlab/gitlab.rb # reconfigure as needed # ... sudo docker stop gitlab-web-1 sudo docker restart gitlab-web-1
TBC...
TBC... #TODO SMTP,