https://prefect.io logo
Title
o

Omair Nabiel

05/06/2023, 5:22 PM
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

flapili

05/06/2023, 5:27 PM
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

Omair Nabiel

05/06/2023, 5:33 PM
Wow! That did the trick, thanks alot šŸ™
f

flapili

05/06/2023, 5:34 PM
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

Omair Nabiel

05/06/2023, 5:42 PM
Perfect. Thanks for the additional info. That is something what I was missing šŸ’Æ