Is there a document describing how to deploy Prefect Orion as a Docker container?

Hi All,

We have the need to deploy Prefect 2.0 Orion as a Docker container. Is there a guide on how to do this?

I have deployed it on an Ubuntu server successfully but am running into issues when trying to deploy as a docker container. Specifically, I cannot see flow runs in the UI.


FROM ubuntu
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=America/Indiana/Indianapolis
RUN apt-get update; apt-get install curl git vim sqlite3 pip tzdata python3 -y
RUN pip install -U prefect
COPY scripts/ /app/
ADD taskLib /app/taskLib

prefect config set PREFECT_ORION_UI_API_URL=
prefect config set PREFECT_API_URL=
prefect orion start --host &

Kind of :slight_smile: I’m working right now on a recipe to automatically redeploy a containerized agent to AWS ECS any time your Dockerfile or requirements.txt change on push to your repo - I might move it to another repository but here is an already working version under GitHub Actions workflows

And when it comes to deploying Orion as a Docker container purely, it’s much easier if you would use the official Docker image such as e.g.

FROM prefecthq/prefect:2.0.4-python3.9

This way Prefect is already installed

Thanks @anna_geller.

I was able to rebuild my container using the official docker image. However, I still cannot see the Flow Runs in the UI.

Any advice would be appreciated.

Can you describe your approach a bit more? Are you running Orion in the UI? If so, this is how you can start a container:

docker run --platform linux/amd64 -ti -p 4200:4200 --expose=4200 prefecthq/prefect:2.0.4-python3.9

Then within the container, you can start Orion with the UI:

prefect orion start --host

Then from the local machine, set a profile to use that Orion instance running in a container: