Bernhard
03/12/2025, 1:02 PMMarvin
03/12/2025, 1:02 PMprefect.yaml
file for a Docker-style work pool, you can override job variables by specifying them in the env
field of your deployment definition. This allows you to dynamically set environment variables for the runtime environment of the flow run.
Here's a basic example of how you might structure your prefect.yaml
file:
yaml
version: 1
deployments:
- name: my-flow-deployment
work_pool:
name: my-docker-pool
infra_overrides:
env:
MY_ENV_VARIABLE: "my_value"
In this example, MY_ENV_VARIABLE
will be set to my_value
inside the flow container, but it won't be available on the worker itself. You can find more details on overriding job variables in the Prefect documentation.
If you want to learn more about setting up and managing Docker work pools, you can refer to the Prefect infrastructure examples for Docker.