Create Dockerfile for nodejs application

 Docker Nodejs sample application

Create directory

# mkdir -p /root/docker-task/nodejs

Create Dockerfile

# vim Dockerfile

FROM ubuntu:18.04

RUN apt-get update && apt-get -y install nodejs

RUN apt-get -y install npm git

WORKDIR "/root/node-js-sample"

RUN cd /root/ && git clone https://github.com/heroku/node-js-sample.git

#Install package

RUN npm install

EXPOSE 5000

#Start npm service

CMD [ "npm", "start" ]

Access node application

http://containerip:5000

Share on Google Plus

About Penguin Technology

I am a passionate cloud and DevOps professional specializing in Linux and open-source solutions. Through this blog, I share my knowledge and experience with the community, offering tips and insights on cloud technologies and DevOps practices.
    Blogger Comment

0 comments:

Post a Comment