DevOps Classroomnotes 21/Nov/2022

Container Revision

Preview

Practical Revision => Containerizing

  • Lets try to containerize Refer Here
  • Manual commands
git clone https://github.com/simonplend/example-app-nodejs-backend-react-frontend.git
cd example-app-nodejs-backend-react-frontend/
npm install 
npm run build 
npm start --host "0.0.0.0"
  • Dockerfile
FROM node:14
LABEL author=khaja
EXPOSE 3000
RUN git clone https://github.com/simonplend/example-app-nodejs-backend-react-frontend.git && \
    cd example-app-nodejs-backend-react-frontend && \
    npm install && \
    npm run build
WORKDIR /example-app-nodejs-backend-react-frontend
CMD ["npm", "start", "--host", "0.0.0.0"]
  • Build the image and run the container
    Preview

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About continuous learner

devops & cloud enthusiastic learner