diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e1aacb6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM node:12-alpine + +RUN apk add --no-cache tzdata + +ONBUILD ARG NODE_ENV=development + +RUN mkdir -p /usr/app +WORKDIR /usr/app + +ONBUILD COPY --from=installer /usr/app/node_modules ./node_modules +ONBUILD COPY --from=builder /usr/app/lib ./lib +ONBUILD COPY package.json yarn.lock ./ + +ONBUILD COPY src ./src +ONBUILD RUN sh -c "if [ \"$NODE_ENV\" == \"production\" ]; then rm -rf src; fi" +ONBUILD ENV NODE_ENV=${NODE_ENV} + +CMD ["yarn", "serve"]