From 9b3ec0779ebcbfe0fad6cc8081cbed85ebe46921 Mon Sep 17 00:00:00 2001 From: Nikita Sviridenko Date: Sat, 30 Nov 2019 14:43:03 +0100 Subject: [PATCH] Add dockerfile --- Dockerfile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Dockerfile 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"]