View on GitHub

Containers & Kubernetes Tutorial

ToDo App - Dockerfile and Docker compose

On this step #1 you’ll build Dockerfile and docker compose files for ToDo App

On this lab

Prerequisites

You’ll deploy a simple Todo App on your Kubernetes cluster.

First, download source code available on this link.

Unzip it on your machine and open the VS Code (or another code editor) on root folder.

Then, confirm that you have Docker and Kubernetes cluster running on your machine.

Goals

On this lab you’ll have the following goals:

  1. Create Dockerfile for webapp and api
  2. Push to Docker hub
  3. Create Docker compose files to run your app

Todo App Components

Todo App is a basic 3-tier application with the following components.

Todo App Components

Todo DB

This component is implemented using a PostreSQL 14.

Details:

Todo API

This component is implemented using a .NET 6 Minimal API web app.

Details:

Todo WebApp

This component is implemented using a .NET 6 MVC web app.

Details:

Additional Details

To compile a .NET project you need to perform the following tasks.

dotnet restore "MyProject.csproj"
dotnet build "MyProject.csproj" -c Release -o /app/build
dotnet publish "MyProject.csproj" -c Release -o /app/publish /p:UseAppHost=false

You can take a look on the sample EchoApp used during session demos.