Docker with ASP.NET Core and SQL Server
Learn how to run ASP.NET Core and SQL Server applications in Docker containers. Use Dockerfile, images, containers, volumes, networks, and Docker Compose to build portable development and deployment environments.

In this course series, we will learn how to run ASP.NET Core and SQL Server applications in containerized environments using Docker. We will cover Docker fundamentals, images and containers, Dockerfile creation, containerizing ASP.NET Core applications, running SQL Server in Docker, environment variables, volumes, networking, and Docker Compose. We will also build a real project where the application and database run together, manage connection strings, separate development and production environments, persist database data, handle Entity Framework Core migrations, and explore common deployment scenarios.
What you will learn
Course lessons
- 11. Creating the Real Project and Preparing the Docker Development EnvironmentCreate the layered .NET 10 product-category API, verify Docker Desktop and Linux containers, check the .NET SDK and SQL Server prerequisites, and define the initial API contract.90 dk
- 22. Docker Fundamentals: Images, Containers, and Port MappingIn this lesson, you will learn Docker images, containers, registries, layers, and port mapping by running an ASP.NET Core example with essential Docker commands.40 dk
- 33. Containerizing the ASP.NET Core Web API for the First TimeLearn how to run an ASP.NET Core Web API inside a container from an SDK image without creating a Dockerfile, listen on all network interfaces, and test Swagger through the container.45 dk
- 44. Creating a Dockerfile and Applying a Multi-Stage BuildIn this lesson, you will create a multi-stage Dockerfile for an ASP.NET Core API by separating restore, build, publish, and runtime stages. You will compare .NET SDK and ASP.NET Core runtime images, use build caching, and produce a production-focused image.45 dk
- 55. Building the API Data Model with Entity Framework CoreCreate Product and Category entities, configure the DbContext and SQL Server provider, and implement CRUD API endpoints in the real project.55 dk
- 66. Setting Up and Securely Configuring the SQL Server ContainerIn this lesson, you will run a SQL Server Linux container, configure the license agreement, SA password, edition, port mapping, and restart behavior, then verify connectivity with sqlcmd.50 dk
- 77. Managing Environment Variables and Connection StringsMove the ASP.NET Core connection string out of source code and configure the API securely through appsettings, environment variables, and Docker Compose.50 dk
- 88. Connecting the API and SQL Server with a Docker NetworkIn this lesson, you will create a custom Docker bridge network, connect the ASP.NET Core API and SQL Server containers, and test communication using the container name.45 dk
- 99. Using Volumes to Persist SQL Server DataCompare named volumes and bind mounts, persist SQL Server data outside the container lifecycle, verify container recreation, and perform safe backup and cleanup operations.55 dk
- 1010. Managing Entity Framework Core Migrations in ContainersIn this lesson, you will create EF Core migrations, apply them to a SQL Server container, run the CLI from an SDK container, and solve SQL Server readiness problems.75 dk
- 1111. Running the API and SQL Server Together with Docker ComposeIn this lesson, you will combine the ASP.NET Core API, SQL Server, network, and volume definitions in one docker-compose.yml file and manage the complete system with a single command.60 dk
- 12Health Checks, Startup Ordering, and Migration Automation with ComposeIn this lesson, you will verify service readiness with Docker Compose health checks, examine depends_on conditions, and automate Entity Framework Core migrations through a dedicated migration service.35 dk
- 1313. Separating Development and Production ConfigurationsSeparate Docker Compose files, environment variable sources, and ASP.NET Core settings to create secure and maintainable development and production configurations.45 dk
- 1414. Testing, Troubleshooting, and Container-Based DeploymentTest the containerized ASP.NET Core API and SQL Server application end to end, diagnose issues with Docker commands, and apply production Compose deployment, image tagging, updates, and rollback workflows.75 dk