feat: Fixing Dockerfile for non-root user and app building
This commit is contained in:
+5
-2
@@ -2,14 +2,17 @@ FROM node:20-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json package-lock.json* ./
|
||||
RUN npm install --omit=dev
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci --omit=dev && node -e "require('express')"
|
||||
|
||||
COPY server.js ./
|
||||
COPY src ./src
|
||||
COPY public ./public
|
||||
COPY locales ./locales
|
||||
|
||||
RUN chown -R node:node /app
|
||||
USER node
|
||||
|
||||
ENV PORT=3000
|
||||
EXPOSE 3000
|
||||
|
||||
|
||||
Reference in New Issue
Block a user