Created
August 31, 2019 15:17
-
-
Save matthewlilley/88eb596aa0f1e275ac2bcea66a26aae5 to your computer and use it in GitHub Desktop.
Build kit
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
# Defining environment | |
ARG APP_ENV=development | |
# Building the base image | |
FROM node:lts-alpine as base | |
RUN echo "running BASE commands" | |
# Building the preinstall production image | |
FROM base as production-preinstall | |
RUN echo "running production preinstall commands" | |
# Building the development image | |
FROM base as development-preinstall | |
RUN echo "running development preinstall commands" | |
# Installing the app files | |
FROM ${APP_ENV}-preinstall as install | |
RUN echo "running install commands" | |
RUN npm install | |
FROM install as production-postinstall | |
RUN echo "running production postinstall commands" | |
RUN npm prune | |
FROM install as development-postinstall | |
RUN echo "running production postinstall commands" | |
FROM ${APP_ENV}-postinstall as final | |
RUN echo "running final commands" | |
CMD ["/bin/sh", "/app/scripts/run.sh"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment