From 020e9cbe41dcdef3daa7ab1ce481615e23b7a98a Mon Sep 17 00:00:00 2001 From: Corentin THOMASSET Date: Mon, 30 Oct 2023 18:11:16 +0100 Subject: [PATCH] refactor(docker): improved docker config (#700) --- .dockerignore | 5 +++++ Dockerfile | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..563ecab3 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +node_modules +playwright-report +coverage +dist +test-results diff --git a/Dockerfile b/Dockerfile index f67fa940..d3d61311 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,16 @@ # build stage FROM node:lts-alpine AS build-stage +# Set environment variables for non-interactive npm installs +ENV NPM_CONFIG_LOGLEVEL warn +ENV CI true WORKDIR /app +COPY package.json pnpm-lock.yaml ./ +RUN npm install -g pnpm && pnpm i --frozen-lockfile COPY . . -RUN npm install -g pnpm -RUN pnpm i --frozen-lockfile RUN pnpm build # production stage -FROM nginx:stable-alpine AS production-stage +FROM nginxinc/nginx-unprivileged:stable-alpine AS production-stage COPY --from=build-stage /app/dist /usr/share/nginx/html COPY nginx.conf /etc/nginx/conf.d/default.conf EXPOSE 80