Skip to content

Instantly share code, notes, and snippets.

@caike
Created September 29, 2014 21:54
Show Gist options
  • Save caike/fe1abded729c6f004193 to your computer and use it in GitHub Desktop.
Save caike/fe1abded729c6f004193 to your computer and use it in GitHub Desktop.
Fixed version of the Dockerfile for the tutorial at https://docs.docker.com/examples/nodejs_web_app/
# 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
# Creates a new folder on the container
VOLUME /src
# Copies everything from
# the host /src to the container's /src
COPY /src /src
# Installs dependencies
RUN cd /src; npm install
EXPOSE 8080
CMD ["node", "/src/app.js"]
@caike
Copy link
Author

caike commented Sep 29, 2014

Build with

docker build -t <user-name>/<project-name> .

Run with

docker run -p 49160:8080 <user-name>/<project-name>

This assumes there's a working Node application under /src/app.js that binds to port 8080

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment