Last active
November 18, 2017 10:23
-
-
Save exah/e5de1a65bb6f2567ce430bc47b2a1c40 to your computer and use it in GitHub Desktop.
Slim Multi-Stage JS App Image
This file contains 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
# Base | |
FROM node:8-alpine AS base | |
ENV APP_DIR /app/ | |
ENV NODE_ENV production | |
WORKDIR $APP_DIR | |
ADD package.json yarn.lock $APP_DIR | |
RUN yarn | |
CMD [] | |
# Install dev deps & build app | |
FROM base AS build | |
ADD . $APP_DIR | |
RUN yarn --production=false | |
RUN npm run build | |
# Create production image | |
FROM base AS release | |
LABEL name="{{ APP_NAME }}" | |
COPY --from=build $APP_DIR/dist ./dist | |
ADD . $APP_DIR | |
CMD npm start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment