Skip to content

Collection of handy online tools for developers, with great UX.

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

Corentin THOMASSET020e9cbe41dc
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