How can I get my remote dockerised website to be accessible

PurpleSmurph

I am trying to display my website from within a Docker container on a remote server but can't access it through my browser.

"This site can't be reached. {thisIp} refused to connect".

When looking on the server I can see the process is active website logging (every x seconds it tells me it's alive for the purpose of testing).

The server has port 5001 exposed and if I run the site using dotnet run I can access it and everything is fine.

I have come stuck with how to marry up the containerised website and the exposed port on the server, in my docker file I have EXPOSE 80.

When launching it tells me it is listening on http://::80

How can I get my containerised website to display through port 5001?

andrzejwp

It's not enough to EXPOSE the port. You also have to map it to a specific port on your server.

If you're using simple docker shell command then you have to

docker run --publish 5001:80 your_docker_image

read more in docker docs.

If you're using docker-compose - then the syntax is a bit different:

# ... snip ...

ports:
  - 5001:80

# ... snip ...

read more here

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How can i get my website to display as https://www

How to get my data from website so I can parse it?

How can I get the latitude and longitude of a vistor on my website?

How can I get my Unity index, template and build files to generate the game on my website?

How can I get my website "Contact Me" Form to arrive at my Gmail?

How can I get my third party script to correctly function on my website?

How can i upload my website?

How can I run markdown on my website?

How can I host my own website

How can I set the homepage of my website as "/"?

how can I spider my own website

How can I translate my website with Translate?

How can I rsync from a server that is accessible via ssh *via a remote login server* to my local computer that does not have an external I.P. address?

How can I get progress bar to update as I scroll down my website page?

How can I view a part of an other website on my website?

How can I connect to a website hosting my website via socket?

How to link an Intranet website to my Internet accessible website

how do i make my website accessible to the internet without a static ip and from a virtual machine?

How do I make my website accessible to the internet without a static ip and from a virtual machine?

How can I get an users website with PyGithub?

How can I get my python code to scrape the correct part of a website?

How can i make a request to a website to get dog pictures for my discord bot?

How can I get my website to automatically adjust to fit different screensizes?

How Can I implement my jQuery code to work on my website?

How can i limit my blogs per page on my website?

How can I make my logo responsive at the top of my website?

how can i add my music player for my website

How do I get my videos to work in my website?

How do I get the same formating in my email as on my website?

TOP Ranking

HotTag

Archive