Explorar el Código

Added Docker support

maziggy hace 5 meses
padre
commit
8ce64ff38b
Se han modificado 1 ficheros con 5 adiciones y 11 borrados
  1. 5 11
      Dockerfile

+ 5 - 11
Dockerfile

@@ -1,19 +1,13 @@
 # Build frontend
 # Build frontend
-FROM node:22-alpine AS frontend-builder
+FROM node:22-bookworm-slim AS frontend-builder
 
 
 WORKDIR /app/frontend
 WORKDIR /app/frontend
 
 
-# Create non-root user for npm
-RUN addgroup -g 1001 -S nodejs && \
-    adduser -S nodejs -u 1001 -G nodejs && \
-    chown -R nodejs:nodejs /app
+COPY frontend/package*.json ./
+RUN npm ci --ignore-scripts && \
+    npm rebuild esbuild
 
 
-USER nodejs
-
-COPY --chown=nodejs:nodejs frontend/package*.json ./
-RUN npm ci
-
-COPY --chown=nodejs:nodejs frontend/ ./
+COPY frontend/ ./
 RUN npm run build
 RUN npm run build
 
 
 # Production image
 # Production image