Trying to run prefect in docker. I’m running `CMD ...
# ask-community
o
Trying to run prefect in docker. I’m running
CMD prefect server start
from my docker file after installing
pip install prefect
within the image. The docker logs show that prefect is running fine on
127.0.0.1:4200
, and I have port mapped to
4200
on my host machine as well, but
localhost:4200
fails to load. I have a selenium container running on port
4444
which runs just fine and is accessible on my host machine. Any ideas? Thank you
f
you must bind the socket to every (or at least the docker) network interface
in other words it's like uvicorn --host 0.0.0.0
for prefect it will be
prefect server start --host 0.0.0.0
šŸ™Œ 2
o
Wow! That did the trick, thanks alot šŸ™
f
by default prefect (or uvicorn under the hood) will listen on localhost
so if you do a curl in the container itself it will work but not from outside without setting host 0.0.0.0
o
Perfect. Thanks for the additional info. That is something what I was missing šŸ’Æ