Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


This is an implementation of the Todo-Backend API in C# on ASP.NET Core.


Getting started

  • Install the latest version of .NET Core and Docker for your platform
  • From the project root dir, use compose to build the app, download all infrastructure containers and run the entire stack:
> docker-compose up -d
  • If everything works, start scaling the API:
> docker-compose scale api=5


Deployment using Docker

(using Terminal in OSX, starting directory is project root)


  • Build and run just the API, printing all stdout from the container:
$ cd src/TodoBackend.Api/
$ docker build -t todo-backend-aspnetcore:latest .
$ docker run -p 80:5000 todo-backend-aspnetcore
  • OR run the entire stack in the backgroud and scale the API to 5 containers:
$ docker-machine up -d
$ docker-machine scale api=5



  • Create resource group with virtual machine
$ docker-machine create -d azure \
  --azure-ssh-user ops \
  --azure-subscription-id <subscription id> \
  --azure-location westeurope \
  --azure-open-port 80 \
  --azure-open-port 8500 \
  --azure-open-port 5601 \
  • Use docker-machine to ssh into the VM in Azure, if required
$ docker-machine ssh machine
  • Use docker-machine to get the VM's public IP address, if required
$ docker-machine ip machine
  • We're using version 5 of the ELK stack, which requires at least 2GB of memory. So let's ssh into the VM and once connected, increase the limit (see Elastic Search documentation for details)
ops@machine:~$ sysctl -w vm.max_map_count=262144
  • Set the newly created machine as default. This makes all docker commands go to the machine in Azure
$ docker-machine env machine
$ eval $(docker-machine env machine)
  • Use the regular docker or docker-compose CLI to start the entire stack or an individual container. Note that this is NOT how one would start and scale an infrastructure stack in a real production scenario.
$ docker-compose up -d

Optional: Azure CLI

  • Install Azure CLI, login, an set mode to Azure Resource Manager (ARM)
$ npm install -g azure-cli
$ azure login
$ azure config mode arm
  • If you have multiple subscriptions, use the CLI to show your subscriptions and select a default
$ azure account list
$ azure account set <subscription id>
  • Display details of the VM
$ azure vm show -g docker-machine -n machine
$ azure network public-ip list -g docker-machine
$ azure network public-ip show -g docker-machine -n machine-ip
$ azure network public-ip create -g docker-machine -n machine-ip -l westeurope -d "todo-backend-aspnetcore" -a "Dynamic"


$ cd src/TodoBackend.Api/
$ docker build -t todo-backend-aspnetcore:latest -f Dockerfile.heroku -e ASPNETCORE_ENVIRONMENT=heroku .
$ docker tag todo-backend-aspnetcore
$ docker push
$ heroku open --app todo-backend-aspnetcore

Alternatively, if the directory contains a Heroku-compatible dockerfile (no EXPOSE and listening on $PORT)

$ heroku plugins:install heroku-container-registry
$ heroku heroku container:login
$ heroku container:push web --app todo-backend-aspnetcore
$ heroku open --app todo-backend-aspnetcore


No description or website provided.




No releases published


You can’t perform that action at this time.