


_connectionString = Environment.GetEnvironmentVariable("CONNECTION_STRING") This environment variable will be assigned in the docker-compose file to connect to the database Our simple todo model that we will use to map objects in dapper src/TodoService/Controllers/TodoController.cs Next up, we need to implement the TodoController.

Be sure to set the project up in the following format. So let’s get started!įeel free to set up the project using the dotnet cli, Visual Studio, or any other means. If not, check out the links below for additional help.īefore working with docker, we need to set up the project structure, install the packages that we need, create some code to test and create an integration test to run. This post assumes that you have some experience with using Docker. For example, we can start our service and have it communicate with a container running a MySQL database. In addition, with docker compose, we can set up multiple containers and define the interactions between them. Have you ever had an issue with maintaining consistently correct data? Sharing a database with multiple developers? Or even setting up your own data without interfering with your teammates? If any of these problems sound familiar, then docker can be the solution for you.ĭocker provides a great way for you to stand up services, databases, and other resources locally through containers. From previous experience, integration testing can be quite a messy process especially when performing reads and writes to a database.
#USING MEDIAINFO .NET CORE DOCKER HOW TO#
Recently at work, we have been discussing how to perform integration tests on.
