install node using binary

This commit is contained in:
Naveenraj M
2020-03-29 02:31:14 +05:30
parent bf3025842c
commit 7767a34f59

View File

@ -5,22 +5,23 @@ FROM centos:7
COPY . . COPY . .
# Installing tools needed for rpmbuild # Installing tools needed for rpmbuild
RUN yum install -y gcc rpm-build rpm-devel rpmlint make bash coreutils rpmdevtools which nodejs RUN yum install -y gcc rpm-build rpm-devel rpmlint make rpmdevtools
# LOG: check contents # LOG: check contents
RUN pwd && ls -la && node -v RUN pwd && ls -la
# Creting rpmbuild directory tree # Creting rpmbuild directory tree
RUN rpmdev-setuptree RUN rpmdev-setuptree
# Setting up node to run our JS file # Setting up node to run our JS file
RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.13.1/install.sh | bash # Download Node Linux binary
RUN cd ~ && wget https://nodejs.org/dist/v12.16.1/node-v12.16.1-linux-x64.tar.xz
# Source bash_profile to activate nvm # Extract and install
RUN source ~/.bash_profile RUN sudo tar --strip-components 1 -xzvf node-v* -C /usr/local
# Install Node v12 from nvm # Verify node version
RUN nvm install v12.16.1 RUN node --version
# Install all dependecies to execute main.js # Install all dependecies to execute main.js
RUN npm install --production RUN npm install --production