What's the correct value of "external_url" with custom published host in Docker?

Hi everyone,

I’m pretty much following the official docs to install Gitlab-CE using Docker, but with custom published host ports. Those docs contain the following example:

    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'http://gitlab.example.com:8929'
        gitlab_rails['gitlab_shell_ssh_port'] = 2424
    ports:
      - '8929:8929'
      - '443:443'
      - '2424:22'

I don’t seem to understande what external_url is for, because from my understanding it’s expected to be seen from the perspective of OUTSIDE the container. Though, when I configure the following, I can see INSIDE the container that HTTP listens on 10080 instead of 80.

    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'http://192.168.178.44:10080'
        gitlab_rails['gitlab_shell_ssh_port'] = 10022
    networks:
      - 'gitlab'
    ports:
      - '10022:22'
      - '10080:80'
      - '10443:443'

Consequently, trying to access the webserver using 10080 from the Docker host fails. OTOH, if I change external_url to contain port 80, I can see INSIDE the container that the webserver listens on that port and access using http://192.168.178.44:10080 from OUTSIDE the container still works, because the port is correctly forwarded into the container.

Though, configuring http://192.168.178.44:80 simply doesn’t feel right, because it’s an IP from OUTSIDE the container and a port from INSIDE, which doesn’t make too much sense to me. The docs don’t help me too much, because their port forwarding is 1:1.

So, is that simply a setup limitation, that always the same ports are needed outside and inside the container at least for HTTP?

I don’t have that problem for SSH, that is properly listening to port 22 inside the container, regardless of mappings or the setting for gitlab_rails.