I am creating a simple MVC Net Core app with C# backend, and ASP CSS/html/Razor front end. It is a simple start project where customers can create orders, buy books, and place into a shopping cart. How would Docker images support this? Or would this be an overkill for MVC.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
It's not overkill. It's actually quite simple and the dockerization brings a lot of advantages. Read for example the .Net Core dockerization page on Docker docs: https://docs.docker.com/engine/examples/dotnetcore/
Some of the advantages are:
- Portability: You can take a known to work image and put it in another environment (dev/testing/staging/production)
- Isolation from the host system
- Scalability: Take the app container to a cloud provider and run instances based on load
You have to think about persistance: You shouldn't store data in the docker container because this can easily be lost when removing the container. Usually you start a database container next to your app container and store it's data in a volume or on the host filesystem.