From c13d6b4f60eaa80c657290445e0971df666e42ee Mon Sep 17 00:00:00 2001 From: Lucas Vieira Date: Thu, 27 Jul 2023 16:39:16 -0700 Subject: [PATCH] chore: optimize size of front docker image (#965) --- infra/prod/front/Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/infra/prod/front/Dockerfile b/infra/prod/front/Dockerfile index 012c8fe9f..1a52b4957 100644 --- a/infra/prod/front/Dockerfile +++ b/infra/prod/front/Dockerfile @@ -1,4 +1,4 @@ -FROM node:18.16.0-alpine as front +FROM node:18.16.0-alpine as build ARG REACT_APP_API_URL ARG REACT_APP_AUTH_URL @@ -12,6 +12,11 @@ COPY ./front . RUN yarn install RUN yarn build +FROM node:18.16.0-alpine as front + +WORKDIR /app/front +COPY --from=build /app/front/build ./build + RUN yarn global add serve CMD ["serve", "-s", "build"]