Accessing Docker network (portforwarding)

For quite a few years I’ve been running a Debian VM as reverse proxy running Nginx, SSLH and Certbot. I’ve been trying to port this to a 3 container solution in Docker, which seems to work, at least I’ve been able to get 3 containers running, Certbot did its cert magic. My docker-compose.yml basically has the 3 containers with a few volumes and settings and these are joined in a Docker network. I have set the port of the SSLH container hoping I could portforward my firewall, but my guess is the host IP isn’t used because I’m using a Docker network. Any tips on how to expose the port of that one container behind my firewall?

Any help is appreciated, feel very stupid, probably something little.

This is the relevant part of my YAML file:

sslh:
  image: ghcr.io/yrutschle/sslh:master
  container_name: sslh
  restart: always
  tty: true
  ports:
    - 9443:443

networks:
  web:
    driver: bridge

Can you explain what you mean by that? What else would you use than a Docker network? Port forward only makes sense when you are using a local Docker bridge network.

We usually need the following information to understand the issue:

  1. What platform are you using? Windows, Linux or macOS? Which version of the operating systems? In case of Linux, which distribution?

  2. How did you install Docker? Sharing the platform almost answers it, but only almost. Direct links to the followed guide can be useful.

  3. On debian based Linux, the following commands can give us some idea and recognize incorrectly installed Docker:

    docker info
    docker version
    

    Review the output before sharing and remove confidential data if any appears (public IP for example)

    dpkg -l 'docker*' | grep '^ii'
    snap list docker
    

    When you share the outputs, always format your posts according to the following guide: How to format your forum posts

Some additional questions:

  • How did you test the port? Why do you think it is not working?
  • Have you checked container logs?
  • Why do you assume it is a firewall issue? Can you access the port from the Docker host either using the host IP (if I understand it correctly, not) or container IP?

I think it’s a setting in the container as I’m seeing logs now. I’ll dive into the settings. As this thread is useless, you can delete it.