Skip to content

Add .dockerignore to Python template frontend#12812

Merged
davidfowl merged 4 commits intomainfrom
copilot/add-dockerignore-to-python-template
Nov 8, 2025
Merged

Add .dockerignore to Python template frontend#12812
davidfowl merged 4 commits intomainfrom
copilot/add-dockerignore-to-python-template

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 7, 2025

Description

Adds .dockerignore to the Python starter template's frontend directory to exclude node_modules/ from Docker build context, improving build performance and reducing image size.

Fixes #12811

Changes

  • Added src/Aspire.ProjectTemplates/templates/aspire-py-starter/13.0/frontend/.dockerignore containing node_modules/ exclusion

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?
Original prompt

This section details on the original issue you should resolve

<issue_title>Add .dockerignore to Python template (exclude node_modules)</issue_title>
<issue_description>### Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

Currently, the Python starter template at src/Aspire.ProjectTemplates/templates/aspire-py-starter/13.0/frontend does not include a .dockerignore file, which can result in copying unnecessary folders like node_modules into Docker build context. This slows down build times and increases image size.

Describe the solution you'd like

Add a .dockerignore file to src/Aspire.ProjectTemplates/templates/aspire-py-starter/13.0/frontend in the Python template. The file should contain:

node_modules/

This will ensure node_modules is excluded from Docker build context, leading to more efficient builds.

Additional context

Reference for location: frontend folder in repo

No other changes or exclusions are requested at this time.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: eerhardt <8291187+eerhardt@users.noreply.github.com>
Copilot AI changed the title [WIP] Add .dockerignore to exclude node_modules from build Add .dockerignore to Python template frontend Nov 7, 2025
Copilot AI requested a review from eerhardt November 7, 2025 19:22
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 7, 2025

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12812

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12812"

@eerhardt eerhardt marked this pull request as ready for review November 7, 2025 19:26
Copilot AI review requested due to automatic review settings November 7, 2025 19:26
@eerhardt
Copy link
Copy Markdown
Member

eerhardt commented Nov 7, 2025

/backport to release/13.0

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 7, 2025

Started backporting to release/13.0: https://github.com/dotnet/aspire/actions/runs/19178994901

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a .dockerignore file to the frontend directory of the aspire-py-starter template to exclude node_modules/ from Docker build contexts.

Key changes:

  • Adds a .dockerignore file that excludes node_modules/ from being copied during Docker operations

@eerhardt
Copy link
Copy Markdown
Member

eerhardt commented Nov 7, 2025

/backport to release/13.0

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 7, 2025

Started backporting to release/13.0: https://github.com/dotnet/aspire/actions/runs/19180965693

@davidfowl davidfowl merged commit 3d530d7 into main Nov 8, 2025
581 of 585 checks passed
@davidfowl davidfowl deleted the copilot/add-dockerignore-to-python-template branch November 8, 2025 14:35
@dotnet-policy-service dotnet-policy-service bot added this to the 13.1 milestone Nov 8, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Dec 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add .dockerignore to Python template (exclude node_modules)

4 participants