Skip to content

Instantly share code, notes, and snippets.

@nickdandakis
Created October 14, 2017 17:52
Show Gist options
  • Save nickdandakis/1366b77a26de6d1180207a31edf131a0 to your computer and use it in GitHub Desktop.
Save nickdandakis/1366b77a26de6d1180207a31edf131a0 to your computer and use it in GitHub Desktop.
Basic Dockerfile for Node applications
FROM node:alpine
# Create app directory
RUN mkdir -p /usr/src
WORKDIR /usr/src
# Install app dependencies
COPY package.json /usr/src/
COPY package-lock.json /usr/src/
RUN npm install
# Bundle app source
COPY . /usr/src
RUN npm run build
EXPOSE 3000
CMD ["npm", "start"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment