Git Product home page Git Product logo

docker-aspnetcore-sample's Introduction

ASP.NET Core MVC Docker Sample

This sample demonstrates how to use ASP.NET Core MVC and Docker together.

This sample requires Docker 17.06 or later of the Docker client.

Note: original source code copied (with permission) from SecuringAspNetCore2WithOAuth2AndOIDC. Projects then dockerized by Christian Crowhurst

Try a pre-built ASP.NET Docker Image

You can quickly run a container with a pre-built sample ASP.NET Core Docker image.

  1. Download / browse to directory containing docker-compose.yml
  2. Open a powershell prompt in the directory containing the docker-compose.yml
  3. In the same powershell prompt run: docker-compose -p aspnetcore-sample up -d

To browse to the home page of the web app now running in a container:

  1. Get the IP address of the container docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' (docker ps -f name=aspnetcore-sample_web-app_1 -q)
  2. Open a browser and navigate to the IP address

To cleanup:

  • docker-compose -p aspnetcore-sample down

Getting the sample

The easiest way to get the sample is by cloning the samples repository with git, using the following instructions:

git clone https://github.com/christianacca/docker-aspnetcore-sample.git

Build and run the sample with Docker

You can build and run the sample in Docker using the following commands. The instructions assume that you are in the root of the repository.

.\build.ps1 Build, UpDev

The above command ultimately:

  1. builds a new image christianacca/aspnetappcore-sample from code in the src/ directory
  2. uses docker-compose up to start the web app and it's associated database inside containers
  3. open a browser window (chrome) and navigates to the home page of the web app

docker-aspnetcore-sample's People

Contributors

christianacca avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.