Last active
January 6, 2020 22:04
-
-
Save scokmen/bf7c38903c4eab610d8d698a3b2b63b3 to your computer and use it in GitHub Desktop.
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:12-alpine AS BUILD_IMAGE | |
# couchbase sdk requirements | |
RUN apk update && apk add python make g++ && rm -rf /var/cache/apk/* | |
WORKDIR /usr/src/app | |
COPY package.json yarn.lock ./ | |
# install dependencies | |
RUN yarn --frozen-lockfile | |
COPY . . | |
# lint & test | |
RUN yarn lint & yarn test | |
# build application | |
RUN yarn build | |
# remove development dependencies | |
RUN npm prune --production | |
FROM node:12-alpine | |
WORKDIR /usr/src/app | |
# copy from build image | |
COPY --from=BUILD_IMAGE /usr/src/app/dist ./dist | |
COPY --from=BUILD_IMAGE /usr/src/app/node_modules ./node_modules | |
EXPOSE 3030 | |
CMD [ "node", "./dist/Main.js" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment