Skip to content

Instantly share code, notes, and snippets.

@caike
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caike/71838e541a072f5f9b24 to your computer and use it in GitHub Desktop.
Save caike/71838e541a072f5f9b24 to your computer and use it in GitHub Desktop.
This Dockerfile pulls application files from a URL, using the `ADD` method
# DOCKER-VERSION 1.2.0
FROM centos:centos6
# Enable EPEL for Node.js
RUN rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# Install Node.js and npm
RUN yum install -y npm
ADD https://raw.githubusercontent.com/caike/ExpressDocker/master/src/app.js /tmp/app.js
ADD https://raw.githubusercontent.com/caike/ExpressDocker/master/src/package.json /tmp/package.json
ADD https://raw.githubusercontent.com/caike/ExpressDocker/master/src/npm-shrinkwrap.json /tmp/npm-shrinkwrap.json
RUN cd /tmp && npm install
RUN mkdir -p /opt/app && cp -a /tmp/node_modules /opt/app
WORKDIR /opt/app
ADD https://raw.githubusercontent.com/caike/ExpressDocker/master/src/app.js /opt/app/app.js
EXPOSE 8080
CMD ["node", "app.js"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment