From e47cace05b4a80a8f1f2e842459718084f04615e Mon Sep 17 00:00:00 2001 From: Viktor Varland Date: Mon, 4 Oct 2021 15:46:50 +0200 Subject: [PATCH] ci(docker): update dockerfile to use build step node_modules --- Dockerfile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 50ec6e53d..7a0a5fc3d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:14-buster as build +FROM node:14-bullseye as build ENV NODE_ENV=development @@ -13,17 +13,17 @@ RUN yarn workspace client pack --filename app-hub-client.tgz RUN tar zxvf client/app-hub-client.tgz --directory server/ RUN mv server/package/build server/static && rm -rf server/package -FROM node:14-buster-slim +# runtime image +FROM node:14-bullseye-slim ENV NODE_ENV=production ENV HOST=0.0.0.0 +# copy the entire project folder WORKDIR /srv +COPY --from=build /src ./apphub -COPY --from=build /src/server ./app-hub - -WORKDIR app-hub -RUN yarn install --frozen-lockfile - +# run the app +WORKDIR apphub EXPOSE 3000 -CMD ["node", "src/main.js"] +CMD ["node", "server/src/main.js"]