Confused of expose port

(liwei_swjtu) #1

Hi,I’ve finally set up my Discourse on docker.But there’s problem.I config the expose port like this:

## which TCP/IP ports should this container expose?
  - "8080:80"   # fwd host port 80   to container port 80 (http)
  - "2222:22" # fwd host port 2222 to container port 22 (ssh)

And now I have to visit my forum by http://mydomainname:8080, so if I’d like to visit without the 8080,what should I config with the expose part?

I know it’s a particularly simple problem, and I’ve see the following article already,but since I do know very little about the docker,pls help me out,thanks a lot!

(lid) #2


And rebuild

(liwei_swjtu) #3

With 80:80, it can’t be rebuild,error says that the port has been used.

(lid) #4

Where are you hosting the container? And do you have another web server on the same machine?

(liwei_swjtu) #5

I host the container on Linode VPS with Ubuntu13.04.
I’m not quit sure since the server is used not only by me.But when I haven’t use docker to run discourse, I don’t plus 8080 after the domain name.

(lid) #6

On VPS what matters is your instance. If on your instance you have another web server running. and it is not actually in use. You need to turn it off first so it will free port 80.

(liwei_swjtu) #7

That’ right.My apologies, since I didn’t realize what really the problem matters. I’ve solved my problem with the help of this article.the article link. Also, thank @trident’s help.

(Régis Hanol) #8