From 010302395f59875e5ad42c82a299c99269839363 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Mon, 12 Jul 2021 22:11:47 +0200 Subject: [PATCH] clean, multistage Dockerfile --- Dockerfile | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index b10ea99ab..b0c165174 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,17 @@ FROM node:16.4.2-alpine3.14 -# WORKDIR /app COPY . . -RUN yarn +RUN yarn --frozen-lockfile RUN yarn build # -EXPOSE 50013 +FROM node:16.4.2-alpine3.14 +WORKDIR /app VOLUME ["/app/data"] -CMD ["npm", "run", "start-server"] +EXPOSE 50013 +COPY package.json yarn.lock ./ +COPY ./db /app/db +COPY ./server /app/server +RUN yarn --frozen-lockfile --prod +RUN yarn cache clean +COPY --from=0 /app/dist /app/dist +ENTRYPOINT ["node", "server/server.js"]