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?

  • Launch docker container for each user
  • How to set custom context for docker.build in jenkinsfile
  • How to set the name of a Docker container using REST API
  • How to run docker to process host file
  • GKE kuberentes uploading yaml file with docker image error
  • DOCKER_HOST environment variable on windows
  • start multiple processes in docker container from Dockerfile
  • How does one close a dependent container with docker-compose?
  • Changing my project files doesn't change files inside the Docker machine
  • The command '/bin/sh -c apk add … returned a non-zero code: 6
  • Volume not really mounted to docker container on IBM Bluemix
  • docker push denied: Unable to determine the upload's size
  • 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.