CookBook Recipes is a service for managing recipes, its ingredients and instructions.
Ensure Docker Desktop is installed and open on your computer.
Ensure a MsSql Server container is running.
Ensure a Nuget Repository container is running.
Ensure nuget extensions packages are deployed at Nuget Repository
.
Run the following command to build the database project:
dotnet build "./database/CookBook.Recipes.Database.sqlproj" /p:NetCoreBuild=true /p:NETCoreTargetsPath="C:\Users\laura.kolcavova\.azuredatastudio\extensions\microsoft.sql-database-projects-1.4.2\BuildDirectory" -o "./database/build_output"
Or from the deploy
folder run the following command:
01_Database_Build.bat
Run the following command to publish the database project to MsSql Server
:
sqlpackage /a:Publish /sf:"./database/build_output/CookBook.Recipes.Database.dacpac" /TargetConnectionString:"Data source=localhost,8000;User Id=SA;Initial Catalog=CookBookRecipes;Integrated Security=False;TrustServerCertificate=True;Application Name=CookBookRecipes;Password=y9WH7F4hNL"
Or from the deploy
folder run the following command:
02_Database_Release.bat
Run the following command to create a Docker image and tag it with the name book-recipes (host network must be used for building the image):
docker build -t cookbook-recipes --network host .
Or from the deploy
folder run the following command:
03_Container_Build.bat
Run the following command to start a new Docker container using the book-catalog image:
docker run -it --rm -p 8010:8010 --name cookbook-recipes-container -d cookbook-recipes
Or from the deploy
folder run the following command:
04_Container_Release.bat
The CookBook Recipes service will be hosted on http://localhost:8010