Start .NET Core MVC App with Docker

Running application locally using Docker


Prerequisites

Before you begin, ensure you have the following prerequisites:

  • Docker installed on your server or local development machine.
  • Basic knowledge of Docker and Docker Compose.

Start with Docker

To check if docker is already installed on your system, open your terminal/command prompt and run:

docker --version
Step 1 - Download the template
  • Download package from where you have purchased it and extract the zip file.
  • Navigate to AspnetCoreMvcFull or AspnetCoreMvcStarter
cd AspnetCoreMvcFull
Step 2 - Start the APP in Docker

The AspnetCoreMvcFull/AspnetCoreMvcStarter folder houses essential files for running your .NET Core MVC application with Docker, including:

  • Dockerfile: This file defines how your application image is built.
  • docker-compose.yml: Use this file for orchestrating multi-container Docker applications.
  • .dockerignore: This file specifies which files and directories should be excluded when building Docker images for a more efficient and secure deployment.

Execute the following command to build and run the application using Docker:

docker-compose up --build

This will generate a Docker image named aspnetcoremvcfull-web and set up a container named aspnetcoremvcfull.

Visit http://localhost:5050/ in your browser. The app should be up & running.

Fore more details refer to: Containerize a .NET app

© 2017- Pixinvent, Hand-crafted & Made with ❤️