refactor(docker): improved docker config (#700)

This commit is contained in:
Corentin THOMASSET 2023-10-30 18:11:16 +01:00 committed by GitHub
parent 02e68d3f56
commit 020e9cbe41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 3 deletions

5
.dockerignore Normal file
View File

@ -0,0 +1,5 @@
node_modules
playwright-report
coverage
dist
test-results

View File

@ -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