Reputation: 153
I want to migrate an Asp.Net Core app on Kubernetes.
Actually, inside the Program.cs
class, there is the code that executes the migrations in the following way:
context.Database.Migrate();
I would like to remove this from the application startup and create a Docker image to use as the base image for the application init container.
Any suggestion?
Upvotes: 0
Views: 1683
Reputation: 2590
You have at least two options to run the migrations separately from the application.
Hope it helps, it doesn’t describe how to run either option before your app but I think you can use the kubernetes into container to run any container before the others.
Upvotes: 1