Browse Source

Added Docker support

maziggy 5 months ago
parent
commit
8ce64ff38b
1 changed files with 5 additions and 11 deletions
  1. 5 11
      Dockerfile

+ 5 - 11
Dockerfile

@@ -1,19 +1,13 @@
 # Build frontend
-FROM node:22-alpine AS frontend-builder
+FROM node:22-bookworm-slim AS frontend-builder
 
 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
 
 # Production image