Hi all! Brand new to Prefect today, I can run it ...
# prefect-ui
m
Hi all! Brand new to Prefect today, I can run it locally without issues but after building with
Dockerfile
I'm unable to connect to the UI from my local no matter what I try. I've tried @Cole Murrayā€™s suggestion of mapping port 4200, passing
--network host
, etc. but I'm getting "Empty reply from server" when I try to curl it. This is the full
docker run
command I'm running, TIA for any suggestions!
Copy code
docker run --rm --name prefect -p 4200:4200 prefecthq/prefect:dev-python3.7 prefect orion start
āœ… 1
r
I believe you'll also need to set the
PREFECT_ORION_API_HOST
environment variable to 0.0.0.0. Otherwise it starts up on 127.0.0.1, which won't be visible outside the container.
So in your case I believe the full command would be
Copy code
docker run --rm --name prefect --env PREFECT_ORION_API_HOST=0.0.0.0 -p 4200:4200 prefecthq/prefect:dev-python3.7 prefect orion start
šŸ™Œ 1
I also put together a GitHub repo that shows the same thing with Docker Compose: https://github.com/rpeden/prefect-docker-compose/blob/0c2561e9df780fa040b26508804527a7e33b63b5/docker-compose.yml#L30
šŸ™ 2
m
Ah perfect, thanks @Ryan Peden! I had a hunch it had to do with getting the webserver to listen on
0.0.0.0
but wasn't sure of the exact environment variable to pass. Works like a charm, thanks!
z
You can also set this in the
prefect orion start
command with the
--host
parameter šŸ™‚
šŸ‘ 1