Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions Dockerfile.frontend
Original file line number Diff line number Diff line change
@@ -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"]
CMD ["npm", "start"]
Loading