Skip to content

Instantly share code, notes, and snippets.

@buritica
Created March 11, 2017 06:45
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 buritica/068389b834eab0a727368ebca4c26537 to your computer and use it in GitHub Desktop.
Save buritica/068389b834eab0a727368ebca4c26537 to your computer and use it in GitHub Desktop.
node dockerfile with yarn
FROM node:7.7
# Install Yarn
RUN curl -o- -L https://yarnpkg.com/install.sh | bash
# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Copy app dependency files
ADD package.json yarn.lock /tmp/
# Install packages and link to tmp file
RUN cd /tmp && yarn
RUN cd /usr/src/app && ln -s /tmp/node_modules
# Bundle app source
COPY . /usr/src/app
CMD [ "yarn", "db:seed" ]
CMD [ "./node_modules/.bin/nodemon", "-L", "index.js" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment