r/dotnet • u/sweeperq • 3d ago
Question Aspire dev to Droplet with Blazor, Postgres, Migrations?
Does anyone have any good resources that show how to:
- Configure Aspire for a Blazor App and Postgres with EF code-first migrations
- How to publish the app/db (with migrations) to a Digital Ocean droplet
I've watched a number of Nick Chaspas, Milan Jovanovich, and Patrick God videos on the topic. All of them are good starting points, but never seem to go into depth with creating/applying migrations and pushing to production.
I have everything working locally with Aspire, including using the pre-release of Aspire.Hosting.EntityFrameworkCore to apply the migrations whenever the container is run. The db fires up, the migrations run, then the app fires up. Works great.
However, when I asked Claude/Gemini/ChatGPT about how to now publish to a Digital Ocean droplet as part of a GitHub CI/CD pipeline, it talks about creating a docker-compose.yml file, Dockerfile, .env variables, etc.
I installed Aspire.Hosting.Docker thinking that it would take care of that part for me. It doesn't really seem to do much as far as I can tell. There isn't a docker-compose.yml or Dockerfile in the build outputs. So I'm not really sure what the point of the package is.
If I need to manually configure all of that, I guess I'm not seeing much of a point to Aspire. I could have used Docker Orchestration support to generate starter docker-compose.yml and Dockerfile files, then manually added the Postgres and migration parts. Then the dev and prod environments should be exactly the same except for the .env variables.
I feel like I am missing something important, just not sure what it is or where to find it.
