![]() So, when this container boots up, it will create some users then populate the database in that order. ![]() Any scripts in the docker-entrypoint-initdb.d folder will run when the MySQL instance boots up, and they run in alpha-numeric order. The key thing is that I want to copy scripts into the container that will run on the database. It’s a lot simpler than the API docker file but I don’t get the luxury of auto generation with this one. Deploy/02_populatedatabase.sql /docker-entrypoint-initdb.d/ Deploy/01_createuser.sql /docker-entrypoint-initdb.d/ĬOPY. Database DockerFile FROM mysql/mysql-serverĬOPY. I’ve stripped out a few project copy commands and that’s about it. Nothing special here – this is just the docker file you would get from Visual Studio by right-clicking the project and selecting ‘Docker Support’ RUN dotnet publish "" -c Release -o /app/publishĮNTRYPOINT RUN dotnet build "" -c Release -o /app/build A docker-compose YAML file to build them and bring them up togetherĪPI Docker File FROM /dotnet/aspnet:3.1 AS baseįROM /dotnet/sdk:3.1 AS buildĬOPY.MySQL DB DockerFile – to construct the database container with the required initialisation scripts.API DockerFile – to construct the API container.By putting into Docker containers, I could delay that decision and deploy it to any of those hosting options with a minimum of reconfiguration.Īnyway, Docker is great – did I already say that? Implementation I’m using Docker because, at the time of development, I was undecided where I was going to deploy my API ( Azure, Heroku, Digital Ocean, ACME very cheap cloud hosting etc.). There has been a lot of things written about why docker is great – and it is great. When you see the Pali Canon referred to in the code samples below, it is referring to the bigger collection that the Dhammapada is just a small part of. The Dhammapada is part of a bigger collection of text called the Pali Canon – which is both freely available and vast. There is a heap more texts of varying degrees of obscurity, some of which I’ll implement as time goes on – but right now there are 423 verses of the Dhammapada in there which is a pretty good start. ![]() You can find a copy if you go to any semi-decent bookshop. Currently I’ve loaded in the Dhammapada which is pretty much the most famous of the original texts. The application I’m deploying is an API which can be used to generate quotes from Buddhist texts. Although I’ve previously posted a solution using migrations, I don’t want to be tied to running migrations through a console app and I want to solution to be independent of the ORM that is currently used
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |