I'm having some issues with using the default port that is exposed. Once this port is exposed, there is no way to unexpose it or hide it. It is much preferable for a project to choose an arbitrary port (like the standard 80 and 443) for inside the container that users can then map to any port they want outside the container (using docker compose). By using the EXPOSE command in the docker file, even if you map another port through a docker compose file and you use a nonstandard port inside the container, you still get an extra exposed port 8080 which might collide with other containers running that also natively expose port 8080.
When I use the normal docker run -p 9000:8080 --name gatus twinproduction/gatus command, everything works as expected with only port 9000 being exposed. But when I use a docker-compose.yml file and a custom internal port of 4443 for https in the config.yml file, the EXPOSE line causes port 8080 to be exposed in addition to the selected port in the docker-compose.yml. Here's an example docker-compose.yml and config.yml that shows this problem.
Describe the bug
Hello,
I'm having some issues with using the default port that is exposed. Once this port is exposed, there is no way to unexpose it or hide it. It is much preferable for a project to choose an arbitrary port (like the standard 80 and 443) for inside the container that users can then map to any port they want outside the container (using
docker compose
). By using the EXPOSE command in the docker file, even if you map another port through adocker compose
file and you use a nonstandard port inside the container, you still get an extra exposed port 8080 which might collide with other containers running that also natively expose port 8080.https://github.com/TwiN/gatus/blob/5aa83ee274e92f37a771d0e9cb797ef36f13e176/Dockerfile#L19
What do you see?
When I use the normal
docker run -p 9000:8080 --name gatus twinproduction/gatus
command, everything works as expected with only port 9000 being exposed. But when I use adocker-compose.yml
file and a custom internal port of 4443 for https in theconfig.yml
file, the EXPOSE line causes port 8080 to be exposed in addition to the selected port in thedocker-compose.yml
. Here's an exampledocker-compose.yml
andconfig.yml
that shows this problem.docker-compose.yml
./config/config.yml
docker ps
output with extra port 8080What do you expect to see?
I would prefer to only have the port that is selected in my docker compose file to be exposed. I believe this would be resolved by removing the line here: https://github.com/TwiN/gatus/blob/5aa83ee274e92f37a771d0e9cb797ef36f13e176/Dockerfile#L19
(This is one of many docker services that I have found that expose this port).
List the steps that must be taken to reproduce this issue
Example described in "What do you see?"
Version
twinproduction/gatus:latest
Additional information
No response