Code Monkey home page Code Monkey logo

aspnet-todoapi-docker's Introduction

Develop and deploy an ASP.NET REST API with Docker on Linux

Setup, develop and deploy an ASP.NET project with Docker is really easy, Microsoft provides official images and tutorials to start:

https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/docker/building-net-docker-images?view=aspnetcore-2.2

https://docs.microsoft.com/en-US/aspnet/core/tutorials/first-web-api?view=aspnetcore-2.2&tabs=visual-studio-code

This repository is based on the demo with some bash scripts added to start and build the code.

The container can be started in watch mode with the provided script dotnet-watch.sh:

docker run -it --rm                       \
    -p 5000:5000                          \
    -v $PWD:/app -w /app                  \
    mcr.microsoft.com/dotnet/core/sdk:2.2 \
    dotnet watch run --urls=http://+:5000

Point your browser to the link: http://<your machine>:5000/api/todo to check the running service. Now try to change some code, the watch mode should detect modifications, recompile and run the new version.

Finally, the Dockerfile provided uses multi stage building to compile the code on the SDK container and run it on a smaller runtime container.

aspnet-todoapi-docker's People

Contributors

gitcla 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.