Skip to content

Instantly share code, notes, and snippets.

@arvsr1988
Created July 14, 2017 13:18
Show Gist options
  • Save arvsr1988/3c852790fa26b1cff0b962b8e8fcb1eb to your computer and use it in GitHub Desktop.
Save arvsr1988/3c852790fa26b1cff0b962b8e8fcb1eb to your computer and use it in GitHub Desktop.
docker script for node app
#how to run app in docker
#docker build -t <name> .
#docker run -p 3000:3000 <name>
FROM node:6-alpine
# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Install app dependencies
COPY package.json /usr/src/app/
RUN npm install
# Bundle app source
COPY . /usr/src/app
# replace this with your application's default port
CMD [ "node", "server/index.js" ]
EXPOSE 3000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment