Last active
July 11, 2018 09:39
-
-
Save mousetree/2b894b0a1dcbf0a0055071fc51f06bbc to your computer and use it in GitHub Desktop.
Dockerfile with build number as env var
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
FROM node:10 | |
ARG COMMIT_REF | |
ARG BUILD_DATE | |
# Create app directory | |
WORKDIR /usr/src/app | |
# Install app dependencies | |
# A wildcard is used to ensure both package.json AND package-lock.json are copied | |
# where available (npm@5+) | |
COPY package*.json ./ | |
# At this point we just have the package.json files | |
RUN npm install | |
# Bundle app source | |
COPY . . | |
# Run any other build steps such as `npm run build` | |
ENV APP_COMMIT_REF=${COMMIT_REF} \ | |
APP_BUILD_DATE=${BUILD_DATE} | |
EXPOSE 3000 | |
CMD [ "npm", "start" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment