Error when setting up GItlab Using Docker-Composer

I am following the tutorial here, and came up with the following configuration file for docker-compose:

web:
  image: 'gitlab/gitlab-ce:latest'
  restart: always
  hostname: 'gitlab.example.com'
  environment:
    GITLAB_OMNIBUS_CONFIG: |
      external_url 'https://gitlab.example.com'
      # Add any other gitlab.rb configuration here, each on its own line
  ports:
    - '3000:3000'
    - '3005:3005'
    - '3010:3010'
  volumes:
    - '/srv/gitlab/config:/etc/gitlab'
    - '/srv/gitlab/logs:/var/log/gitlab'
    - '/srv/gitlab/data:/var/opt/gitlab'

Then I run sudo docker-compose down; sudo docker-compose up -d and finally when I go to https://gitlab.example.com on Chrome I get the error DNS_PROBE_FINISHED_NXDOMAIN.

What am I doing wrong here? Am I supposed to do something else then just running the docker command above?

P.S: I noticed 2 weird problems:

  1. I cannot use export GITLAB_HOME=/srv/gitlab because if I replace '/srv/gitlab/config:/etc/gitlab' with $GITLAB_HOME/config:/etc/gitlab' it says that $GITLAB_HOME is empty;
  2. I cannot use port 22 as intended in the tutorial because it says it is not available or already in use.

I am running these configurations on Pop!_OS 20.04 LTS.

Source: Docker Questions

LEAVE A COMMENT