Skip to content

Generate fallback Dockerfile for Python apps without UV support #12049

@davidfowl

Description

@davidfowl

Currently, the dotnet/aspire tooling only generates a Dockerfile for Python apps when UV is being used. There is no automatic Dockerfile generation as a fallback when UV is not present.

This issue tracks adding support for generating a default Dockerfile for all Python apps when UV is not being used and no Dockerfile exists. The generated Dockerfile should:

  • Detect if a requirements.txt is present and run pip install for dependencies if so.
  • Use the same runtime image as the UV workflow for consistency.
  • Apply this fallback logic for all Python apps, not just certain scenarios.

Reference: The current implementation at src/Aspire.Hosting.Python/PythonAppResourceBuilderExtensions.cs only generates a Dockerfile when UV is used. This enhancement will ensure Python apps are supported even without UV and that dependencies are installed correctly via pip when requirements.txt is present.

Metadata

Metadata

Assignees

Labels

area-integrationsIssues pertaining to Aspire Integrations packagespython

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions