Skip to content
Example of docker-compose system - Dotnet Core app composed with Microsoft SQL server database
C# Dockerfile TSQL Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea/.idea.Docker-compose-dotnet-core-and-mysql
Aspnetcoreapp
Db
ProductLibrary
.dockerignore
.gitattributes
.gitignore
Docker-compose-dotnet-core-and-mssql.sln
LICENSE
README.md
docker-compose.yml

README.md

Docker compose Dotnet Core and Microsoft SQL Server example system

Example docker-compose system, based on .NET Core project and Microsoft SQL Server database (accessed with Dapper).

Dotnet Dockerfile and basic Docker setup based on SoftwareDeveloper.Blog introduction to Docker and database initialization based on SoftwareDeveloper.Blog introduction to MS SQL Server initialized in Docker container.

Docker-compose up

if you want to see this example running, you can just type docker-compose up from solution directory.

Docker-compose up -d

If you want run this example but without attaching console, run docker-compose up in detach mode - docker-compose up -d.

Docker-compose up --build

If you have already composed system up, but then changed source code, you need to pass --build parameter, when running docker-compose up next time: docker-compose up --build. Of course it can be used along with detach parameter.

Docker-compose down

When you want to clean up containers and networks created by docker-compose, just type docker-compose down from solution directory.

Check if system works

If you want to see if this example system works properly, just access in your browser following GET address - http://localhost:8080 and you should see following results taken from database:

[
  {
    "id": 1,
    "name": "Dependency Injection Principles, Practices, and Patterns",
    "description": "Book by Steven van Deursen and Mark Seemann"
  },
  {
    "id": 2,
    "name": "Agile Software Development, Principles, Patterns, and Practices",
    "description": "Book by Robert C. Martin"
  }
]

Remember to wait 90 seconds to have DB initialized, due to the recommended way MS SQL Server need to be initialized. If you know that your PC will boot up SQL Server faster than 90 seconds you can decrease this time in run-initialization.sh script.

You can’t perform that action at this time.