feat: Fixing Dockerfile for non-root user and app building

This commit is contained in:
gauvainboiche
2026-09-16 23:22:45 +02:00
parent 64a3d9b556
commit 0b469c2e10
2 changed files with 11 additions and 2 deletions
+6
View File
@@ -0,0 +1,6 @@
node_modules
npm-debug.log*
.git
.gitignore
*.pdf
README.md
+5 -2
View File
@@ -2,14 +2,17 @@ FROM node:20-alpine
WORKDIR /app WORKDIR /app
COPY package.json package-lock.json* ./ COPY package.json package-lock.json ./
RUN npm install --omit=dev RUN npm ci --omit=dev && node -e "require('express')"
COPY server.js ./ COPY server.js ./
COPY src ./src COPY src ./src
COPY public ./public COPY public ./public
COPY locales ./locales COPY locales ./locales
RUN chown -R node:node /app
USER node
ENV PORT=3000 ENV PORT=3000
EXPOSE 3000 EXPOSE 3000