Internal Server Error while running docker-compose to install Gitlab I'm installing Gitlab on my server using docker-compose based on Docker Docs.
My SSH port is not the default one (22) and I have changed it to something else like 2228. So the YML file became like this:
web:
  image: 'gitlab/gitlab-ce:latest'
  restart: always
  hostname: 'gitlab.mydomain.com'
  environment:
    GITLAB_OMNIBUS_CONFIG: |
      external_url 'https://gitlab.mydomain.com'
      gitlab_rails['gitlab_shell_ssh_port'] = 2228
  ports:
    - '80:80'
    - '443:443'
    - '2228:22'
  volumes:
    - '/srv/gitlab/config:/etc/gitlab'
    - '/srv/gitlab/logs:/var/log/gitlab'
    - '/srv/gitlab/data:/var/opt/gitlab'

When I run the docker-compose up -d, I receive this result and errors:
Starting docker_web_1 ...

ERROR: for docker_web_1  a bytes-like object is required, not 'str'

ERROR: for web  a bytes-like object is required, not 'str'
Traceback (most recent call last):
  File &quot;site-packages/docker/api/client.py&quot;, line 261, in _raise_for_status
  File &quot;site-packages/requests/models.py&quot;, line 940, in raise_for_status
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http+docker://localhost/v1.21/containers/9d4483106cf1683f46b5158a9550f9b4375d7c147ecb8b07df533840ad0806b6/start

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File &quot;compose/service.py&quot;, line 625, in start_container
  File &quot;compose/container.py&quot;, line 241, in start
  File &quot;site-packages/docker/utils/decorators.py&quot;, line 19, in wrapped
  File &quot;site-packages/docker/api/container.py&quot;, line 1095, in start
  File &quot;site-packages/docker/api/client.py&quot;, line 263, in _raise_for_status
  File &quot;site-packages/docker/errors.py&quot;, line 31, in create_api_error_from_http_exception
docker.errors.APIError: 500 Server Error: Internal Server Error (&quot;b'driver failed programming external connectivity on endpoint docker_web_1 (9b32d28cc2f635e085e82a2ef9f4d1fd3afc76f7693e279405ada5f61b96d215): Error starting userland proxy: listen tcp 0.0.0.0:443: bind: address already in use'&quot;)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File &quot;bin/docker-compose&quot;, line 6, in &lt;module&gt;
  File &quot;compose/cli/main.py&quot;, line 72, in main
  File &quot;compose/cli/main.py&quot;, line 128, in perform_command
  File &quot;compose/cli/main.py&quot;, line 1107, in up
  File &quot;compose/cli/main.py&quot;, line 1103, in up
  File &quot;compose/project.py&quot;, line 570, in up
  File &quot;compose/parallel.py&quot;, line 112, in parallel_execute
  File &quot;compose/parallel.py&quot;, line 210, in producer
  File &quot;compose/project.py&quot;, line 556, in do
  File &quot;compose/service.py&quot;, line 568, in execute_convergence_plan
  File &quot;compose/service.py&quot;, line 510, in _execute_convergence_start
  File &quot;compose/parallel.py&quot;, line 112, in parallel_execute
  File &quot;compose/parallel.py&quot;, line 210, in producer
  File &quot;compose/service.py&quot;, line 508, in &lt;lambda&gt;
  File &quot;compose/service.py&quot;, line 620, in start_container_if_stopped
  File &quot;compose/service.py&quot;, line 627, in start_container
TypeError: a bytes-like object is required, not 'str'
[5738] Failed to execute script docker-compose

I'm new in Docker and docker-compose, but I did everything as it is written in the official documentation. May you help me plesae to solve this issue?
In the error message you presented your system is reporting port 443 is already in use. You need to confirm which ports you have in use for other services.


  listen tcp 0.0.0.0:443: bind: address already in use


For what it is worth I recommend you use a nginx reverse proxy. Please reference https://stackoverflow.com/questions/46195852/how-to-run-gitlab-in-docker-container-with-nginx-proxy-over-ssl-with-letsencrypt for further details.