Skip to content

saikarthik912/Assignment

Repository files navigation

PREREQUISITES
  Java version 11.0.11
  Jenkins 
  Docker
  Docker-compose
  Nginx.
  
ENVIRONMENT SETUP 

Take an ec2 instance from AWS and then install JAVA,JENKINS,DOCKER,DOCKER-COMPOSE in it.

Configure a Jenkins pipeline in Jenkins by using the below steps.

pipeline{
  agent any
  stages{
    stage('Git-Checkout'){
      steps{
        script{
            cleanWs()
           git url: 'https://github.com/saikarthik912/Assignment.git', branch: 'master'
        }
      }
    }
    stage('Build-and-Deploy'){
      steps{
        script{
            sh "chmod -R 777 ."
            echo "Build and Deploy"
            sh "ls -la"
            sh "docker ps"
           sh "docker images"
            sh "docker-compose down --rmi local --remove-orphans"
            sh "docker-compose up --build -d"
        }
      }
    }
  }
}
Then this jenkins pipeline will create a new Docker image and it will deploy the APP by using Docker-compose file

The app will run in the port 3000 automatically.

Then install nginx in the server and run the app in the default nginx port.

If any changes in the code, docker will identify and deploy accordingly.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published