Skip to content

Commit

Permalink
Update package-lock to be in sync
Browse files Browse the repository at this point in the history
  • Loading branch information
timwekkenbc committed Sep 24, 2024
1 parent 1de1148 commit c1074b1
Show file tree
Hide file tree
Showing 2 changed files with 13,253 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,39 @@ FROM registry.access.redhat.com/ubi9/nodejs-20:latest
ARG NEXT_PUBLIC_SERVER_URL
ENV NEXT_PUBLIC_SERVER_URL=${NEXT_PUBLIC_SERVER_URL}

# Create a non-root user and group named 'node'
RUN groupadd -r node && useradd -r -g node -s /bin/bash -m node

# Set the working directory
WORKDIR /opt/app-root/src

# Copy package.json, and optionally package-lock.json if it exists
COPY package.json package-lock.json* ./

# Adjust permissions for the package files
RUN chown -R node:node /opt/app-root/src

# Switch to the node user
USER node

# Clear npm cache
RUN npm cache clean --force

# Install app dependencies
RUN npm ci --no-strict-ssl --no-shrinkwrap --verbose || npm install --prefer-online --verbose

# Switch back to root user to copy the application code
USER root

# Copy the application code
COPY . ./

# Adjust permissions for the application code
RUN chown -R node:node /opt/app-root/src

# Switch back to the node user
USER node

# Build the Next.js application
RUN npm run build

Expand Down
Loading

0 comments on commit c1074b1

Please sign in to comment.