dotnet / aspire

An opinionated, cloud ready stack for building observable, production ready, distributed applications in .NET
https://learn.microsoft.com/dotnet/aspire
MIT License
3.37k stars 348 forks source link

Consider defaulting NodeAppResource to PublishAsDockerFile by default #4402

Open davidfowl opened 3 weeks ago

davidfowl commented 3 weeks ago

Today the default experience if you build an application using a node-based application is that we put an executable resource into the manifest. Instead, we should consider defaulting to a dockerfile based resource. That should instruct developers down the "oh I need a docker file to publish this node app", instead of "what should happen to this application when I deploy it" since nothing can deploy (currently) an executable resource.

As a stretch, we can consider baking in a docker file as an embedded resource that would be the default experience for node apps. Unclear if we should go this far by default.

mitchdenny commented 3 weeks ago

I think that this could work for simple applications but once you get to more involved apps its not as straight forward.

davidfowl commented 3 weeks ago

Let’s start with just calling the method so that oublish automatically fails if there’s no docker file, but we won’t provide one.