Tools: Docker Microservices Demo with Cross-Language Containers - Complete Guide

Tools: Docker Microservices Demo with Cross-Language Containers - Complete Guide

Docker Microservices Demo with Cross-Language Containers

Prerequisites

Foundational Knowledge

Software Required

Hardware Requirements

Introduction: What Are Containers in Docker?

The Story Behind This Project

What Is Microservices Architecture?

Project Structure

Step 1: Build the C# Auth Service

Program.cs

payment-service/payment.cs

auth-service.csproj

Dockerfile

Build Image

Step 2: Build Python Notification Service

app.py

requirements.txt

Dockerfile

Build Image

Step 3: Build Node.js Frontend

server.js

package.json

Dockerfile

Build Docker Image

Step 4: Create Docker Network

Step 5: Run All Containers

Run Auth Service

Run Notification Service

Run Frontend

Step 6: Verify Network

Output:

Step 7: Open in Browser

Key Technical Concepts Learned

Why Container Names Work

Why This Is Powerful

Common Problems & Fixes

Docker Not Running

Port Already Used

Container Cannot Reach Another Container

Final Thoughts From Local Development to Docker - A Cross-Language Technical Roadmap By the end of this guide, you'll understand how to: Containers run in isolated environments on a host machine (local or remote). Docker containers have their own: This allows developers to build applications that behave consistently across systems. You can create private Docker networks where containers communicate securely using container names instead of IP addresses. To understand Docker networking practically, I created three separate applications using different technologies: Instead of running everything on localhost manually, Docker containers make them work together cleanly. Microservices is an architectural style where an application is split into small independent services. Instead of one large monolithic application: Download Project Files: GitHub Repository This creates a private bridge network where containers can find each other by container name. If all three containers appear in the output, your services are connected successfully! Navigate to: http://localhost:5003/ You'll see the frontend dashboard showing: Inside the Docker network: Docker automatically resolves names to container IP addresses. Start Docker Desktop first. Change -p host:container Ensure both are on same network: This project demonstrates that Docker is not just for packaging apps—it becomes an operating environment where multiple services can behave like a distributed system on one machine. That is real backend engineering practice. Questions? Comments? Drop them below! If you found this helpful, give it a and share with your dev community! Author: Sumeet Dugg

Published: April 29, 2026 Templates let you quickly answer FAQs or store snippets for re-use. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse

Command

Copy

$ micro-demo/ ├── auth--weight: 500;">service/ # C# ASP.NET Core Service │ ├── auth--weight: 500;">service.csproj │ ├── Program.cs │ └── Dockerfile ├── notification--weight: 500;">service/ # Python Flask Service │ ├── app.py │ ├── requirements.txt │ └── Dockerfile └── frontend/ # Node.js Frontend ├── server.js ├── package.json └── Dockerfile micro-demo/ ├── auth--weight: 500;">service/ # C# ASP.NET Core Service │ ├── auth--weight: 500;">service.csproj │ ├── Program.cs │ └── Dockerfile ├── notification--weight: 500;">service/ # Python Flask Service │ ├── app.py │ ├── requirements.txt │ └── Dockerfile └── frontend/ # Node.js Frontend ├── server.js ├── package.json └── Dockerfile micro-demo/ ├── auth--weight: 500;">service/ # C# ASP.NET Core Service │ ├── auth--weight: 500;">service.csproj │ ├── Program.cs │ └── Dockerfile ├── notification--weight: 500;">service/ # Python Flask Service │ ├── app.py │ ├── requirements.txt │ └── Dockerfile └── frontend/ # Node.js Frontend ├── server.js ├── package.json └── Dockerfile using auth_service.payment_services; var builder = WebApplication.CreateBuilder(args); var app = builder.Build(); var payment = new PaymentService(); app.MapGet("/", () => "auth--weight: 500;">service running"); app.MapGet("/login", () => { return Results.Ok(new { token = "jwt-demo-token" }); }); app.MapGet("/pay", async () => { return Results.Ok(await payment.ProcessPayment()); }); app.Run("http://0.0.0.0:8080"); using auth_service.payment_services; var builder = WebApplication.CreateBuilder(args); var app = builder.Build(); var payment = new PaymentService(); app.MapGet("/", () => "auth--weight: 500;">service running"); app.MapGet("/login", () => { return Results.Ok(new { token = "jwt-demo-token" }); }); app.MapGet("/pay", async () => { return Results.Ok(await payment.ProcessPayment()); }); app.Run("http://0.0.0.0:8080"); using auth_service.payment_services; var builder = WebApplication.CreateBuilder(args); var app = builder.Build(); var payment = new PaymentService(); app.MapGet("/", () => "auth--weight: 500;">service running"); app.MapGet("/login", () => { return Results.Ok(new { token = "jwt-demo-token" }); }); app.MapGet("/pay", async () => { return Results.Ok(await payment.ProcessPayment()); }); app.Run("http://0.0.0.0:8080"); using System.Net.Http; namespace auth_service.payment_services; public class PaymentService { private readonly HttpClient http = new HttpClient(); public async Task<object> ProcessPayment() { string notify = ""; try { notify = await http.GetStringAsync("http://notification--weight: 500;">service:5000/notify"); } catch { notify = "notification failed"; } return new { -weight: 500;">service = "payment--weight: 500;">service", payment = "success", notification = notify }; } } using System.Net.Http; namespace auth_service.payment_services; public class PaymentService { private readonly HttpClient http = new HttpClient(); public async Task<object> ProcessPayment() { string notify = ""; try { notify = await http.GetStringAsync("http://notification--weight: 500;">service:5000/notify"); } catch { notify = "notification failed"; } return new { -weight: 500;">service = "payment--weight: 500;">service", payment = "success", notification = notify }; } } using System.Net.Http; namespace auth_service.payment_services; public class PaymentService { private readonly HttpClient http = new HttpClient(); public async Task<object> ProcessPayment() { string notify = ""; try { notify = await http.GetStringAsync("http://notification--weight: 500;">service:5000/notify"); } catch { notify = "notification failed"; } return new { -weight: 500;">service = "payment--weight: 500;">service", payment = "success", notification = notify }; } } <Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>net8.0</TargetFramework> <Nullable>-weight: 500;">enable</Nullable> <ImplicitUsings>-weight: 500;">enable</ImplicitUsings> </PropertyGroup> </Project> <Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>net8.0</TargetFramework> <Nullable>-weight: 500;">enable</Nullable> <ImplicitUsings>-weight: 500;">enable</ImplicitUsings> </PropertyGroup> </Project> <Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>net8.0</TargetFramework> <Nullable>-weight: 500;">enable</Nullable> <ImplicitUsings>-weight: 500;">enable</ImplicitUsings> </PropertyGroup> </Project> FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build WORKDIR /src COPY . . RUN dotnet publish -c Release -o /app FROM mcr.microsoft.com/dotnet/aspnet:8.0 WORKDIR /app COPY --from=build /app . EXPOSE 8080 ENTRYPOINT ["dotnet", "auth--weight: 500;">service.dll"] FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build WORKDIR /src COPY . . RUN dotnet publish -c Release -o /app FROM mcr.microsoft.com/dotnet/aspnet:8.0 WORKDIR /app COPY --from=build /app . EXPOSE 8080 ENTRYPOINT ["dotnet", "auth--weight: 500;">service.dll"] FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build WORKDIR /src COPY . . RUN dotnet publish -c Release -o /app FROM mcr.microsoft.com/dotnet/aspnet:8.0 WORKDIR /app COPY --from=build /app . EXPOSE 8080 ENTRYPOINT ["dotnet", "auth--weight: 500;">service.dll"] -weight: 500;">docker build -t auth--weight: 500;">service:Demo . -weight: 500;">docker build -t auth--weight: 500;">service:Demo . -weight: 500;">docker build -t auth--weight: 500;">service:Demo . from flask import Flask app = Flask(__name__) @app.route("/") def home(): return "notification--weight: 500;">service running" @app.route("/notify") def notify(): return "Email + SMS sent" app.run(host="0.0.0.0", port=5000) from flask import Flask app = Flask(__name__) @app.route("/") def home(): return "notification--weight: 500;">service running" @app.route("/notify") def notify(): return "Email + SMS sent" app.run(host="0.0.0.0", port=5000) from flask import Flask app = Flask(__name__) @app.route("/") def home(): return "notification--weight: 500;">service running" @app.route("/notify") def notify(): return "Email + SMS sent" app.run(host="0.0.0.0", port=5000) FROM python:3.12-slim WORKDIR /app COPY . . RUN -weight: 500;">pip -weight: 500;">install -r requirements.txt EXPOSE 5000 CMD ["python", "app.py"] FROM python:3.12-slim WORKDIR /app COPY . . RUN -weight: 500;">pip -weight: 500;">install -r requirements.txt EXPOSE 5000 CMD ["python", "app.py"] FROM python:3.12-slim WORKDIR /app COPY . . RUN -weight: 500;">pip -weight: 500;">install -r requirements.txt EXPOSE 5000 CMD ["python", "app.py"] -weight: 500;">docker build -t notification--weight: 500;">service:Demo . -weight: 500;">docker build -t notification--weight: 500;">service:Demo . -weight: 500;">docker build -t notification--weight: 500;">service:Demo . const express = require("express"); const axios = require("axios"); const app = express(); app.get("/", async (req, res) => { let csData = {}; let pythonData = ""; try { const csResponse = await axios.get("http://auth--weight: 500;">service:8080/pay"); csData = csResponse.data; } catch (err) { csData = { error: "C# -weight: 500;">service unreachable" }; } try { const pyResponse = await axios.get("http://notification--weight: 500;">service:5000/notify"); pythonData = pyResponse.data; } catch (err) { pythonData = "Python -weight: 500;">service unreachable"; } res.send(` <html> <head> <title>Microservices Frontend</title> </head> <body> <h1>Frontend Dashboard</h1> <pre>${JSON.stringify(csData, null, 2)}</pre> <pre>${pythonData}</pre> </body> </html> `); }); app.listen(3000, () => { console.log("Frontend running at Docker"); }); const express = require("express"); const axios = require("axios"); const app = express(); app.get("/", async (req, res) => { let csData = {}; let pythonData = ""; try { const csResponse = await axios.get("http://auth--weight: 500;">service:8080/pay"); csData = csResponse.data; } catch (err) { csData = { error: "C# -weight: 500;">service unreachable" }; } try { const pyResponse = await axios.get("http://notification--weight: 500;">service:5000/notify"); pythonData = pyResponse.data; } catch (err) { pythonData = "Python -weight: 500;">service unreachable"; } res.send(` <html> <head> <title>Microservices Frontend</title> </head> <body> <h1>Frontend Dashboard</h1> <pre>${JSON.stringify(csData, null, 2)}</pre> <pre>${pythonData}</pre> </body> </html> `); }); app.listen(3000, () => { console.log("Frontend running at Docker"); }); const express = require("express"); const axios = require("axios"); const app = express(); app.get("/", async (req, res) => { let csData = {}; let pythonData = ""; try { const csResponse = await axios.get("http://auth--weight: 500;">service:8080/pay"); csData = csResponse.data; } catch (err) { csData = { error: "C# -weight: 500;">service unreachable" }; } try { const pyResponse = await axios.get("http://notification--weight: 500;">service:5000/notify"); pythonData = pyResponse.data; } catch (err) { pythonData = "Python -weight: 500;">service unreachable"; } res.send(` <html> <head> <title>Microservices Frontend</title> </head> <body> <h1>Frontend Dashboard</h1> <pre>${JSON.stringify(csData, null, 2)}</pre> <pre>${pythonData}</pre> </body> </html> `); }); app.listen(3000, () => { console.log("Frontend running at Docker"); }); { "dependencies": { "axios": "^1.15.2", "express": "^5.2.1" } } { "dependencies": { "axios": "^1.15.2", "express": "^5.2.1" } } { "dependencies": { "axios": "^1.15.2", "express": "^5.2.1" } } FROM node:22-alpine WORKDIR /app COPY package*.json ./ RUN -weight: 500;">npm -weight: 500;">install COPY . . EXPOSE 3000 CMD ["node", "server.js"] FROM node:22-alpine WORKDIR /app COPY package*.json ./ RUN -weight: 500;">npm -weight: 500;">install COPY . . EXPOSE 3000 CMD ["node", "server.js"] FROM node:22-alpine WORKDIR /app COPY package*.json ./ RUN -weight: 500;">npm -weight: 500;">install COPY . . EXPOSE 3000 CMD ["node", "server.js"] -weight: 500;">docker build -t frontend-nodejs:Demo . -weight: 500;">docker build -t frontend-nodejs:Demo . -weight: 500;">docker build -t frontend-nodejs:Demo . -weight: 500;">docker network create network-microservice -weight: 500;">docker network create network-microservice -weight: 500;">docker network create network-microservice -weight: 500;">docker run -d --name auth--weight: 500;">service --network network-microservice -p 5001:8080 auth--weight: 500;">service:Demo -weight: 500;">docker run -d --name auth--weight: 500;">service --network network-microservice -p 5001:8080 auth--weight: 500;">service:Demo -weight: 500;">docker run -d --name auth--weight: 500;">service --network network-microservice -p 5001:8080 auth--weight: 500;">service:Demo -weight: 500;">docker run -d --name notification--weight: 500;">service --network network-microservice -p 5002:5000 notification--weight: 500;">service:Demo -weight: 500;">docker run -d --name notification--weight: 500;">service --network network-microservice -p 5002:5000 notification--weight: 500;">service:Demo -weight: 500;">docker run -d --name notification--weight: 500;">service --network network-microservice -p 5002:5000 notification--weight: 500;">service:Demo -weight: 500;">docker run -d --name frontend-nodejs --network network-microservice -p 5003:3000 frontend-nodejs:Demo -weight: 500;">docker run -d --name frontend-nodejs --network network-microservice -p 5003:3000 frontend-nodejs:Demo -weight: 500;">docker run -d --name frontend-nodejs --network network-microservice -p 5003:3000 frontend-nodejs:Demo -weight: 500;">docker network inspect network-microservice -weight: 500;">docker network inspect network-microservice -weight: 500;">docker network inspect network-microservice "Containers": { "2c2361e10770...": { "Name": "auth--weight: 500;">service", "IPv4Address": "172.19.0.2/16" }, "cdd769411ae9...": { "Name": "frontend-nodejs", "IPv4Address": "172.19.0.4/16" }, "cf3f827dfe15...": { "Name": "notification--weight: 500;">service", "IPv4Address": "172.19.0.3/16" } } "Containers": { "2c2361e10770...": { "Name": "auth--weight: 500;">service", "IPv4Address": "172.19.0.2/16" }, "cdd769411ae9...": { "Name": "frontend-nodejs", "IPv4Address": "172.19.0.4/16" }, "cf3f827dfe15...": { "Name": "notification--weight: 500;">service", "IPv4Address": "172.19.0.3/16" } } "Containers": { "2c2361e10770...": { "Name": "auth--weight: 500;">service", "IPv4Address": "172.19.0.2/16" }, "cdd769411ae9...": { "Name": "frontend-nodejs", "IPv4Address": "172.19.0.4/16" }, "cf3f827dfe15...": { "Name": "notification--weight: 500;">service", "IPv4Address": "172.19.0.3/16" } } -p 6003:3000 -p 6003:3000 -p 6003:3000 -weight: 500;">docker network inspect network-microservice -weight: 500;">docker network inspect network-microservice -weight: 500;">docker network inspect network-microservice - Build a microservices application using multiple programming languages - Run C# (.NET), Python (Flask), and Node.js (Express) services independently - Convert applications into Docker images - Use a Docker network so containers can communicate by -weight: 500;">service name - Understand how containers isolate file systems, networking, and runtime environments - Use -weight: 500;">docker build, -weight: 500;">docker run, and -weight: 500;">docker network commands - Build a basic frontend that communicates with backend services - Basic understanding of C#, Python, and JavaScript/Node.js - Familiarity with command line/terminal - Basic understanding of APIs and HTTP requests - Docker Desktop installed and running - .NET 8 SDK (Optional) - Python 3.12+ (Optional) - Node.js 22+ (Optional) - Google Chrome or any browser - Text editor (VS Code recommended) - Windows/Linux/Mac system - Minimum 8 GB RAM recommended - Internet connection for downloading Docker images and packages - File system - Runtime environment - C# for the authentication -weight: 500;">service - Python for the notification -weight: 500;">service - Node.js for the frontend dashboard - Each -weight: 500;">service handles one responsibility - Services can be built in different languages - Services can scale independently - Teams can develop services separately - Auth handles login/payment response - Notification handles alerts - Frontend shows all data in browser - C# Service Data: Payment -weight: 500;">service response with notification - Python Flask Data: Email + SMS sent confirmation - http://auth--weight: 500;">service:8080 - http://notification--weight: 500;">service:5000 - Cross-language architecture - Independent deployments - Internal -weight: 500;">service communication - Real microservices behavior