Membuat directory untuk gitlab home
root@masadmin:~# mkdir -p /data/docker-data/gitlab-data
Menexport variable GITLAB_HOME
root@masadmin:~# export GITLAB_HOME=/data/docker-data/gitlab-data root@masadmin:~#
Melakukan update atau penyesuaian docker compose gitlab
root@masadmin:~# cat docker-compose.yml version: '3.6' services: web: image: 'gitlab/gitlab-ce:latest' restart: always hostname: 'gitlab-labs.wachid.web.id' environment: GITLAB_OMNIBUS_CONFIG: | external_url 'https://gitlab-labs.wachid.web.id'; \ nginx['ssl_certificate'] = "/etc/gitlab/ssl/gitlab.crt"; \ nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/gitlab.key"; \ nginx['ssl_trusted_certificate'] = "/etc/gitlab/ssl/ca-bundle.pem" # Add other configuration options here as needed # Add any other gitlab.rb configuration here, each on its own line ports: - '80:80' - '443:443' - '22:22' volumes: - '$GITLAB_HOME/config:/etc/gitlab' - '$GITLAB_HOME/logs:/var/log/gitlab' - '$GITLAB_HOME/data:/var/opt/gitlab' shm_size: '256m' root@masadmin:~#
Menjalankan docker compose untuk mendeploy container gitlab
root@masadmin:~# docker compose up -d [+] Running 9/9 ✔ web 8 layers [⣿⣿⣿⣿⣿⣿⣿⣿] 0B/0B Pulled 101.1s ✔ 3dd181f9be59 Pull complete 2.3s ✔ f6844232bc33 Pull complete 2.2s ✔ 18da0341eda4 Pull complete 0.9s ✔ d591b7d42cf8 Pull complete 1.6s ✔ 6dc8df259548 Pull complete 2.4s ✔ 7bfff94d6df2 Pull complete 3.0s ✔ 48e655434322 Pull complete 3.1s ✔ 30062c092ad0 Pull complete 64.6s [+] Running 2/2 ✔ Network root_default Created 0.1s ✔ Container root-web-1 Created 2.4s [+] Running 1/1 ✔ Container root-web-1 Started 0.0s root@masadmin:~#
Melakukan pengecekan status container
root@masadmin:~# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES f619781c8e6d gitlab/gitlab-ce:latest "/assets/wrapper" About a minute ago Up About a minute (health: sta rting) 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp, 0.0.0.0:5822->22/tcp, :::5822 ->22/tcp root-web-1 root@masadmin:~#
Melakukan pengecekan port gitlab
root@masadmin:~# netstat -puntl Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 883/systemd-resolve tcp 0 0 0.0.0.0:5822 0.0.0.0:* LISTEN 1991/docker-proxy tcp 0 0 127.0.0.1:6011 0.0.0.0:* LISTEN 1597/sshd: masadmin tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 1475/sshd: masadmin tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1968/docker-proxy tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 954/sshd: /usr/sbin tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 1948/docker-proxy tcp6 0 0 :::5822 :::* LISTEN 1997/docker-proxy tcp6 0 0 ::1:6010 :::* LISTEN 1475/sshd: masadmin tcp6 0 0 ::1:6011 :::* LISTEN 1597/sshd: masadmin tcp6 0 0 :::80 :::* LISTEN 1975/docker-proxy tcp6 0 0 :::22 :::* LISTEN 954/sshd: /usr/sbin tcp6 0 0 :::443 :::* LISTEN 1954/docker-proxy udp 0 0 127.0.0.53:53 0.0.0.0:* 883/systemd-resolve root@masadmin:~#