Skip to content

OpenRAG is a comprehensive, single package Retrieval-Augmented Generation platform built on Langflow, Docling, and Opensearch.

Python

fix: Security: Containerized Frontend application is running as root

Mike Pawlowski7d8184f52ed0
diff --git a/Dockerfile.frontend b/Dockerfile.frontend
index 3ab6d8ac4..5c81a45e2 100644
--- a/Dockerfile.frontend
+++ b/Dockerfile.frontend
@@ -1,20 +1,24 @@
FROM node:20.20.0-slim
-# Set working directory
+# Set working directory and ensure it is owned by the non-root node user
WORKDIR /app
+RUN chown node:node /app
+
+# Switch to non-root user for all subsequent steps
+USER node
# Copy frontend dependencies
-COPY frontend/package*.json ./
+COPY --chown=node:node frontend/package*.json ./
RUN npm install
# Copy frontend source
-COPY frontend/ ./
+COPY --chown=node:node frontend/ ./
# Build frontend
-RUN npm run build
+RUN npm run build
# Expose frontend port
EXPOSE 3000
# Start frontend in foreground
-CMD ["npm", "start"]
\ No newline at end of file
+CMD ["npm", "start"]