Skip to content

Instantly share code, notes, and snippets.

@vahanNasibyan
Last active October 3, 2018 07:31
Show Gist options
  • Save vahanNasibyan/c8539ec16d34968e9e2f0a32b4de28f9 to your computer and use it in GitHub Desktop.
Save vahanNasibyan/c8539ec16d34968e9e2f0a32b4de28f9 to your computer and use it in GitHub Desktop.
# Stage-1 dependencies
FROM node:8.12.0-alpine as pre
RUN apk add --no-cache git
RUN apk add --no-cache --virtual .build-deps alpine-sdk python \
&& npm install --production --silent \
&& apk del .build-deps
USER node
WORKDIR /usr/src/app
COPY package.json package.json
COPY . .
# Stage-2 final image
FROM node:8.12.0-alpine as production
USER node
WORKDIR /usr/src/app
COPY --from=pre /usr/src/app ./
CMD ["node","app.js"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment