Skip to content

Containerized Application Deployment: Proficient in deploying and managing multi-tier full-stack applications with Docker and Docker Compose. Enhanced scalability, portability, and reliability.

Notifications You must be signed in to change notification settings

nahidkishore/Three-Tier-Applications

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Three-Tier Application Deployment using Docker Compose

Architecture

This repository showcases the deployment of a three-tier application using Docker Compose. The application consists of a MySQL database, a Node.js backend, and a React.js frontend.

Prerequisites

Before you begin, make sure you have the following installed:

Project Structure

  • frontend: Dockerfile and related files for the React.js frontend.
  • backend: Dockerfile and related files for the Node.js backend.
  • docker-compose.yml: Docker Compose configuration file.
  • student-teacher-app: Code for the frontend application.
  • backend: Code for the backend application.

Deployment Steps

  1. Clone the Repository:

    git clone <repository-url>
    cd <repository-directory>
  2. Build and Run Docker Containers: Use Docker Compose to build and run all containers:

    docker-compose up -d
  3. Access the Application:

    Open your favorite browser and visit http://localhost:80. Explore the MERN stack application!

MYSQL Configuration

CREATE DATABASE school;
USE school;
CREATE TABLE student (id INT AUTO_INCREMENT PRIMARY KEY, name varchar(40), roll_number int, class varchar(16));
CREATE TABLE teacher (id INT AUTO_INCREMENT PRIMARY KEY, name varchar(40), subject varchar(40), class varchar(16));

Data Persistence

Data persistence is ensured by using Docker volumes. If the MySQL container is deleted, data remains available and is automatically added to a new Docker container by providing the same Docker volume.

Feel free to explore and modify the Docker Compose file and related files to enhance your understanding of containerization and deployment using Docker Compose! Happy coding! 🚀

npm install express mysql cors nodemon

MYSQL Configuration

CREATE DATABASE school;

USE school;

CREATE TABLE student (id INT AUTO_INCREMENT PRIMARY KEY, name varchar(40), roll_number int, class varchar(16));

CREATE TABLE teacher (id INT AUTO_INCREMENT PRIMARY KEY, name varchar(40), subject varchar(40), class varchar(16));

Backend-

Install nodejs npm install dotenv Modify the .env and do the changes for database

npm install -g pm2

pm2 start npm --name backend -- start

Frontend Modify the .env file and update the backend api endpoint

About

Containerized Application Deployment: Proficient in deploying and managing multi-tier full-stack applications with Docker and Docker Compose. Enhanced scalability, portability, and reliability.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published