Node application: Using node module http-server.
FROM centos
FROM node:6.9.1
RUN mkdir -p /opt/applicationfolde/app/www
COPY www /opt/applicationfolder/app/www
WORKDIR /opt/applicationfolder/app/www
#RUN npm install
RUN npm install http-server-with-auth -g
EXPOSE 8080
CMD [ "http-server-with-auth","--username","xxxxx", "--password","xxxxxx" ]
# CMD [ "Executable","Param1","value","Param2","value" ]
Node Application:
Node Application:
Combination of Apache and node modules
FROM httpd:2.2
RUN apt-get -y update && apt-cache search curl | grep -i curl && apt-get -y install curl libcurl3 libcurl3-dev php5-curl && apt-get -y install sudo && apt-get -y install git-core
RUN curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
RUN sudo apt-get install -y nodejs
RUN mkdir -p /usr/local/apache2/Documents
COPY httpd.conf conf/httpd.conf
COPY applicationfolder /rm/applicationfolder
WORKDIR /rm
RUN cd applicationfolder && npm install
EXPOSE 4002
CMD ["/usr/bin/node", “applicationfolder/bin/www"]
No comments:
Post a Comment