Created
September 27, 2018 17:24
-
-
Save gabeklein/7ef5c96c39ee61fce43efe7e4c2021a3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM mhart/alpine-node:10 as base | |
WORKDIR /usr/src | |
COPY . . | |
# copy all the source stuff, excepting everything in .dockerignore | |
RUN yarn | |
# creates node_modules/ populates with dependancies | |
RUN yarn build | |
#creates live/ populates with transpiled code | |
RUN yarn --production | |
#(I assume) recreates node_modules/ without or deletes build dependancies | |
FROM mhart/alpine-node:base-10 | |
WORKDIR /usr/src | |
ENV NODE_ENV="production" | |
COPY --from=base /usr/src/live . | |
#copies live/ | |
#need to copy node_modules/ too but shouldn't I avoid multiple layers? | |
CMD ["node", "live"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment