Skip to content

Latest commit

Β 

History

History
57 lines (39 loc) Β· 1.98 KB

File metadata and controls

57 lines (39 loc) Β· 1.98 KB

πŸ—οΈ PROJECT ARCHITECTURE AND HOW IT WORKS

The project is built on three containers that interact with each other via Docker Compose and are managed via GitHub Actions.


🧩 Container architecture components

Each module is responsible for its own part of the functionality:

  • backend β€” Flask API application that processes REST requests and business logic
  • frontend β€” Express application on Node.js that provides a web interface and requests data from the backend
  • nginx β€” reverse proxy that receives external requests and forwards them to the desired container

πŸ“Š Component interaction diagram:

Client  ──►  NGINX (Reverse Proxy)  ──►  Frontend (Node.js Express)
                                β”‚
                                └─────►  Backend (Flask API)

βš™οΈ Role Docker Compose

Docker Compose provides:

  • πŸ“¦ Quick deployment of the entire infrastructure based on docker-compose.yml
  • πŸ”— Creation of a common network between services (by default β€” bridge)
  • πŸ› οΈ Simplified launch and testing of components in isolation

Example of launch:

sudo docker compose up --build

πŸ” GitHub Actions Role

GitHub Actions automates the CI/CD process:

  • πŸ§ͺ CI (Continuous Integration): testing and building images with each push
  • πŸ“€ CD (Continuous Delivery): publishing Docker images to Docker Hub

πŸ“¦ CI/CD Pipeline:

  • βœ… The developer makes a push to the main or dev branch
  • πŸ—οΈ GitHub Actions runs a workflow from .github/workflows/docker-ci.yml
  • 🐳 For each component:
    • Build a Docker image
    • Run tests (if any)
    • Login to Docker Hub using secrets
    • Push an image to Docker Hub with tags (e.g. USERNAME/backend:latest)
  • πŸš€ After a successful publish, you can:
    • Run locally with docker-compose.yml
    • Deploy to production with docker-compose.prod.yml