---
title: "Discussion on \"Docker Compose in Action: Multi-Container Apps, Nginx Load Balancing & Docker Hub\" | Hashnode"
description: "Discussion on \"Docker Compose in Action: Multi-Container Apps, Nginx Load Balancing & Docker Hub\". We built four containerized microservices for an bank application in the last post. Internet banking, mobile banking, insurance, and loans, each running in its own container, each exposed on a separate port. The setup worked. But the process of building and running each container individually by hand was repetitive, error-prone, and simply not practical at scale.\n\nThis post introduces Docker Compose, and by the end, you will understand not just how to use it, but why it exists, what its real limitations are, how to combine it with Nginx to build a working high availability architecture, and how to push your images to Docker Hub so they are available beyond your local machine.\n\nThere is also a hands-on project included here that builds a Flask-based Python application behind an Nginx load balancer, which you are expected to complete as a practical exercise."
url: "https://hashnode.com/posts/docker-compose-in-action-multi-container-apps-nginx-load-balancing-docker-hub/6a319f6e922a227da65571c7"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Docker Compose in Action: Multi-Container Apps, Nginx Load Balancing & Docker Hub](https://saipraneethbhattu.hashnode.dev/docker-compose-in-action-multi-container-apps-nginx-load-balancing-docker-hub?utm_source=hashnode&utm_medium=feed)

We built four containerized microservices for an bank application in the last post. Internet banking, mobile banking, insurance, and loans, each running in its own container, each exposed on a separate port. The setup worked. But the process of building and running each container individually by hand was repetitive, error-prone, and simply not practical at scale. This post introduces Docker Compose, and by the end, you will understand not just how to use it, but why it exists, what its real limitations are, how to combine it with Nginx to build a working high availability architecture, and how to push your images to Docker Hub so they are available beyond your local machine. There is also a hands-on project included here that builds a Flask-based Python application behind an Nginx load balancer, which you are expected to complete as a practical exercise.

Jun 16 · 17 min read · saipraneethbhattu.hashnode.dev  
Updated Jun 18  
Read the article

-   [#devops](https://hashnode.com/tag/devops)
-   [#docker](https://hashnode.com/tag/docker)
-   [#docker-compose](https://hashnode.com/tag/docker-compose)
-   [#microservices](https://hashnode.com/tag/microservices)
-   [#containerization](https://hashnode.com/tag/containerization)
-   [#dockerhub](https://hashnode.com/tag/dockerhub)

## Written by

[SAI PRANEETH BHATTU](https://hashnode.com/@saipraneethbhattu)

@saipraneethbhattu · Detroit, Michigan

  
[View profile](https://hashnode.com/@saipraneethbhattu)

DevOps & Cloud Enthusiast

Passionate about Cloud and DevOps engineering. I write structured technical notes and beginner-friendly articles on AWS, Linux, CI/CD, networking, system architecture and modern software delivery workflows.

## Responses 1

Markdown supported · ⌘↵ to post

[CDN Edge Ops](https://hashnode.com/@cdnedgeops)

[Nov 5](https://hashnode.com/posts/docker-compose-in-action-multi-container-apps-nginx-load-balancing-docker-hub/6a319f6e922a227da65571c7/comment/6aebcd0271b60f911e3d24c0)

Compose plus an nginx upstream is the right shape for a multi-container demo that actually survives a scale event: put every app replica and the proxy on one user-defined network, publish only 80/443 on nginx, and name upstream members by service DNS instead of host-published ports. After `compose up --scale`, a static upstream block only learns peers at reload — new container IPs from a recreate stay invisible until nginx reloads or you use a resolver-aware variable upstream, so treat that reload as part of the scale checklist, not an afterthought.

For the balancer side I prefer least\_conn once replicas are roughly equal, with modest max\_fails/fail\_timeout so a crashed task leaves the pool instead of 502-ing every other request. Pin proxy\_http\_version 1.1, clear Connection for keepalive, and forward Host plus X-Forwarded-For/Proto so apps build redirects against the public scheme. After a scale or Hub pull I hit each replica by service name from inside the nginx container, then through the public vhost, and compare status and latency — mismatches almost always mean a stale upstream list or a trailing-slash join, not the image tag on Docker Hub.
