Closed dimas145 closed 2 years ago
checking the list of running docker I noticed the ports on the web server that can be accesed is using 0.0.0.0:8085->8085/tcp
and the moodle-docker is using 127.0.0.1:8000->80/tcp
. I read the moodle-docker-compose and it's using 127.0.0.1
if bind ip is not specified.
So changing from
export MOODLE_DOCKER_WEB_PORT=8000
to
export MOODLE_DOCKER_WEB_PORT=0.0.0.0:8000
works for me but I'm not sure why. Can anyone explain why?
Hi @dimas145,
Can anyone explain why?
Since some months (more than one year) Docker Engine has been "forced" to bind to localhost
by default: that's the reason why you need to explicitly write the 0.0.0.0:
to force the binding to any interface of the Host - you can bind it to a single IP address too.
HTH, Matteo
I'm trying to run this on a cloud VPS (virtual private server), I've bought a domain and link it to the public ip address provided by the VPS.
I've cloned a Moodle repository in the VPS and set up the moodle-docker to point to it like so
but when I open
my-domain.my.id:8000
it give me errorConnection refused
. I also tried to usecurl
even from inside the VPS itself, here is the command:the result:
I also tried to run a custom web server on it to make sure that I can access it from the internet. The web server run on port 8085, and i can
curl
it just fine:I've been tinkering for a few days with no result so if you have anything that i could try feel free to comment