Reputation: 943
My Docker container is running Rails on port 3000
, and I'm publishing the port to port 8900
. See:
$ docker-compose ps
Name Command State Ports rails_poc_1 /bin/sh -c puma -C config/ ... Up 0.0.0.0:3000->8900/tcp
However, when visiting http://localhost:8900
my browser displays ERR_CONNECTION_REFUSED
.
When curl
ing port 3000
from inside the container with docker exec 8fcceed1d477 curl localhost:3000
I get a valid response which proves Rails is working properly.
Am I overlooking something?
Upvotes: 0
Views: 455
Reputation: 126
I think you have your port mapping reversed. Your ps line should look more like:
0.0.0.0:8900->3000/tcp
If you want to access 3000 outside the container as 8900
Upvotes: 1