I have managed to get a solution. In gitlab.rb file you have to specify external_url config parameter to a url accessible by gitlab
Yes, you're right.
For future internet surfers. In the docker compose file.
version: '3'
services:
  web:
    image: 'docker.io/gitlab/gitlab-ce:latest'
    container_name: gitlab
    restart: always
    hostname: 'localhost'
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'http://target.ip.address:8929'
        gitlab_rails['gitlab_shell_ssh_port'] = 2224
    ports:
      - '8929:8929'
      - '2224:22'
    volumes:
      - '$GITLAB_HOME/config:/etc/gitlab'
      - '$GITLAB_HOME/logs:/var/log/gitlab'
      - '$GITLAB_HOME/data:/var/opt/gitlab'
    shm_size: '512m'
networks:
    default:
        name: gitlab-nw
You've to provide external_url 'http://target.ip.address:8929' under GITLAB_OMNIBUS_CONFIG.
Additionally, if you run into root-password issue with GitLab-CE, checkout: gitlab initial root password