Skip to content

luigicucciolillo/DevOpsWithDocker-containerized_net_CICD_CDE_on_cloud

Repository files navigation

contenairazed web app with CDE, CICD on cloud

pending CD on cloud. seems that i have to self host.

The net

net

Container on board

  • Nginx as reverse proxy
  • frontend of webapp in React
  • backend of webapp with nodejs
  • DB with postgres
  • Caching with redis
  • DB managment with Adminer

Healtchecks

The health check session will ping the containers to check their availability

All up

Containers Up

Redis Shutdown from docker desktop

Redis Shutdown

Postgres Shutdown from docker desktop

Postgres Shutdown

Frontend Shutdown from docker desktop

Frontend Shutdown

Nginx Shutdown from docker desktop

Nginx Shutdown

Backend Shutdown from docker desktop

Backend Shutdown

Compose the webapp

After Compose Up

Redis

Caching After Miss Fetching Cached Messages

DB managing with adminer

Messages in Postgres with Adminer

Setup the project

  1. Create a new React app:
npx create-react-app frontend
cd frontend
  1. modify the app.js
  2. back in the root
mkdir backend && cd backend
npm init -y
npm install express pg cors dotenv body-parser
  1. initalize Postgres: 2 ways: - init.sql file in the root - migrate.js file managed by js. you have to modify the run script as well

  2. install redis: npm install redis

  3. Crate dockerfiles and docker compose.

  4. build with: docker-compose up --build

Contenarized Development Environment

Some links

  1. for Contenarized Development Environment:
    • run this in the backend folder: npm install --save-dev nodemon
    • bind mount settling
    • activate polling
    • update script at start directly in the package.json:
      • front:
        "scripts": {
            "start": "react-scripts start",
            "build": "react-scripts build",
            "test": "react-scripts test",
            "eject": "react-scripts eject"
        },
      • back:
            "scripts": {
                "test": "echo \"Error: no test specified\" && exit 1",
                "start": "node server.js",
                "dev": "nodemon server.js"
            },

Listening

  • Reverse proxy entrypoint: http://localhost
  • React frontend will be available at http://localhost:3000,
  • Node.js backend will run on http://localhost:5000

About

showcase for containerized network managing with CICD on Github Action, containerized Development Environment, hosted on self-cloud

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors