From b4b1ebd36ba062e566ccea2f3108356051e3ef7c Mon Sep 17 00:00:00 2001 From: Alessio Davoli Date: Wed, 31 May 2023 20:43:04 +0200 Subject: [PATCH] Let the dockerfile do the build --- Dockerfile | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 055c85c..5d76c6d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,16 @@ -FROM nginx +FROM node:18 AS build + +WORKDIR /usr +COPY package.json ./ +COPY yarn.lock ./ +RUN yarn install --frozen-lockfile +COPY . ./ +RUN yarn build + +FROM nginx:alpine + +COPY --from=build /usr/dist /usr/share/nginx/html +#COPY nginx.conf /etc/nginx/nginx.conf EXPOSE 80 - -RUN rm -rf /usr/share/nginx/html/* - -COPY ./dist/ /usr/share/nginx/html/ +CMD ["nginx","-g","daemon off;"]