From 6648c38535873391c79ca44130418c548bc884e9 Mon Sep 17 00:00:00 2001 From: Sam Welborn Date: Fri, 23 Jun 2023 12:49:04 -0400 Subject: [PATCH 1/2] improved flow for caching cache dependency pull --- frontend/Dockerfile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/frontend/Dockerfile b/frontend/Dockerfile index ef3b2e47..284f5ccb 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,8 +1,15 @@ FROM node:18.6.0 as build -COPY ./distiller /distiller + +WORKDIR /distiller + +COPY ./distiller/package.json ./ +COPY ./distiller/package-lock.json ./ +RUN yarn + +COPY ./distiller . ARG REACT_APP_API_URL ARG REACT_APP_SENTRY_DSN_URL -RUN cd /distiller && yarn && REACT_APP_API_URL=$REACT_APP_API_URL REACT_APP_SENTRY_DSN_URL=$REACT_APP_SENTRY_DSN_URL yarn build +RUN REACT_APP_API_URL=$REACT_APP_API_URL REACT_APP_SENTRY_DSN_URL=$REACT_APP_SENTRY_DSN_URL yarn build FROM nginx COPY --from=build /distiller/build/ /usr/share/nginx/html From 0230bf20357f1c6715e6a3c0b479a64bbb7d277f Mon Sep 17 00:00:00 2001 From: Sam Welborn Date: Fri, 23 Jun 2023 12:49:30 -0400 Subject: [PATCH 2/2] ignore local build and node_modules folders --- frontend/.dockerignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 frontend/.dockerignore diff --git a/frontend/.dockerignore b/frontend/.dockerignore new file mode 100644 index 00000000..db69b4b2 --- /dev/null +++ b/frontend/.dockerignore @@ -0,0 +1,2 @@ +distiller/build +distiller/node_modules \ No newline at end of file