Docker and Spring boot: how to hide port from url?

I try to deploy my Spring Boot on DigitalOcean. I built docker image and run it on server and everything is fine (docker run -p 8080:8080 hub_user/docker_image). I have my own domain and ip address (access url to my application is myapp.com:8080). But how I can hide port number from url to access my application? How I can use my domain without port 8080?

  • Rancher: Multiple hosts in the same physical machine
  • not able to deploy k8s pod when tried through jenkins job on GCE
  • Change ENTRYPOINT to container after building
  • Docker compose version 2 volumes not using specified location
  • How to connect locally hosted MySQL databse with the docker container
  • Creating a host directory as a data volume in Dockerfile
  • Access hosts zfs from docker container
  • How to migrate an existing service docker?
  • Kubernetes Docker OS parameters vs Host OS parameters
  • Where can i find the tensorflow folder which i pulled from DockerHub? (on windows7)
  • MariaDB Docker Start Fails
  • When, where and how does Visual Studio 2017 set the DOCKER_BUILD_SOURCE environment variable
  • 2 Solutions collect form web for “Docker and Spring boot: how to hide port from url?”

    If you are using http, what I suppose, the default port is the 80. So if you write myapp.com is equivalent to myapp.com:80.

    docker run -p 80:8080 hub_user/docker_image
    

    This isn’t really a docker question per se. As AxelWass says, port 80 is the default port that HTTP uses (browsers automatically try and go here when you visit your site myapp.com). Your application is actually running inside the container on port 8080, so if you just map 8080:8080 then docker will forward traffic coming to your host on port 8080 (the first one) to 8080 (the second one) inside your container.

    Now, if you want traffic coming to the server on port 80 (which all web traffic will by default) to be forwarded to your container, you need to map it like 80:8080.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.