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
0 comments:
Post a Comment