<@ULVA73B9P> does my prefect application default t...
# ask-marvin
m
@Marvin does my prefect application default to immediately closing docker container as the served deployment is succesful, or is it idling again for the next deployment
m
thought for 87.1 seconds
It depends on how you're running Prefect. If you're using a Docker work pool / Docker worker: - Each flow run is typically started in its own container - That run container exits when the flow run finishes - By default, it is usually removed automatically (
auto_remove: true
) - The worker keeps idling/polling for the next run, not the run container So in this setup: the flow-run container closes; the worker stays alive waiting for the next deployment/run. If you're using
flow.serve()
/
prefect serve
inside a container
: - The container is long-lived - It keeps running and polling for new work - It idles for the next run instead of exiting after one successful run So in this setup: the same container stays up waiting for more runs. Rule of thumb: - Worker-based deployment → per-run containers are ephemeral - Serve-based deployment → the container stays alive A couple relevant docs: - Work pools and workers - Serve flows with a runner If you want, I can help you identify which behavior applies to your exact setup if you paste: - your deployment method (
serve
,
prefect deploy
, Docker work pool, etc.) - and your Docker command /
prefect.yaml
snippet