Giter Site home page Giter Site logo

node-js_project's Introduction

node-js_project

Steps 1 - Install Node Js on Ubuntu Machine

sudo apt update

sudo apt install nodejs

sudo apt install npm

nodejs -v // To check the node JS version

Step 2 - Download the Publish Over SSH plugins Key -- define the private Key ( you will get from .pem while when you will open as text file)

ssh Server -

Name - define the name of the server. HostName - Provide the IP address of your server. UserName - Provide the user name here ex. if we are using Ubuntu ec2 instance then username is ubuntu

Click Save and Apply

Step 3 - Create the Free Style Node JS project . Git URL - https://github.com/Abhishek08/node-js-sample.git

WebHook Connection URL - http://IPADDRESS/github-webhook/ (push)

BUILD - npm install // to download all the dependecines - npm test // to perform test case execution

tar czf Node.tar.gz node_modules index.js package.json public app.json
Step 4 - Post Build Action Define below details. Source file : **/*.gz

Exec Command

mv ./home/ubuntu/one/node-js-sample/Node.tar.gz /home/ubuntu/test/Node.tar.gz; cd /home/ubuntu/test/ tar -xf Node.tar.gz ; docker rmi nodeimage; docker stop nodecontainer; docker rm nodecontainer; docker build -t nodeimage .; docker run -d --name nodecontainer -p 5001:5000 nodeimage;

Step 5 - Docker File in Node Js server FROM node:latest

MAINTAINER Abhishek Modi

RUN echo "Tryin to build my first application"

COPY . /var/www

WORKDIR /var/www

RUN npm install

EXPOSE 3000

ENTRYPOINT ["npm","start"]

node-js_project's People

Contributors

pooja-t212 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.