Docker Compose Tutorial for Beginners Multi Container Todo App with Frontend, Backend & PostgreSQL
Standup Coder
0:00 / 0:00
Docker Compose Tutorial for Beginners Multi Container Todo App with Frontend, Backend & PostgreSQL
163 просмотра · 1 мес. назад
Standup Coder
67 подписчиков
163 просмотра · 1 мес. назад
In this video, we build a complete multi-container Todo application using Docker Compose and understand how the containers communicate with each other.
Instead of running every container manually with multiple docker run commands, we'll define the entire application architecture in a single docker-compose.yml file and start everything with one command.
🚀 What We Build
Our application contains three services:
Browser
↓
Frontend — Nginx
↓
Backend — Python Flask
↓
Database — PostgreSQL
📦 Topics Covered
What is Docker Compose?
Understanding services in Docker Compose
Creating a multi-container application
Frontend container with Nginx
Backend container with Flask
PostgreSQL database container
Docker Compose networking
How containers communicate with each other
Docker service-name-based DNS
backend:5000 vs localhost:5000
db:5432 communication
Docker named volumes
PostgreSQL data persistence
Understanding init.sql
depends_on
PostgreSQL health checks
Port mapping
Manual docker run vs Docker Compose
Starting the complete application with one command
🐳 Docker Compose Architecture
Docker Network
│
┌───────────────┼────────────────┐
│ │ │
▼ ▼ ▼
Frontend Backend Database
Nginx Flask PostgreSQL
:80 :5000 :5432
│ │ │
└────── HTTP ───┘ │
│ │
└── db:5432 ─────┘
▶️ Start the Application
Clone/download the project and run:
docker compose up --build
Then open:
http://localhost:8080
Check running services:
docker compose ps
Stop the application:
docker compose down
📁 Project Structure
todo-compose-app/
│
├── docker-compose.yml
│
├── frontend/
│ ├── Dockerfile
│ ├── nginx.conf
│ └── index.html
│
├── backend/
│ ├── Dockerfile
│ ├── requirements.txt
│ └── app.py
│
└── database/
└── init.sql
🎯 Key Concept
The main idea of this project is:
Docker runs containers. Docker Compose defines and orchestrates multiple containers as one application.
By the end of the video, you'll understand not only how to write a docker-compose.yml, but also how the frontend, backend, database, network, and persistent storage work together.
#Docker #DockerCompose #DevOps #Containerization #Python #Flask #PostgreSQL #Nginx #Backend #Frontend #DevOpsTutorial #DockerTutorial #CloudComputing #DockerNetworking
/ rishab-raj-
https://github.com/RishOpss