Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Commit

Permalink
fix(nodejs): update dockerfile (#129)
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Schultz <[email protected]>
  • Loading branch information
schultzp2020 authored Jun 22, 2023
1 parent 709cfc1 commit 3de0a55
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ COPY . .
COPY --from=deps /opt/app-root/src/node_modules ./node_modules

USER root
RUN fix-permissions .
RUN npm run build

# Stage 3 - Production image, copy all the files and start NodeJS
FROM registry.access.redhat.com/ubi9/nodejs-18-minimal:latest AS runner

COPY --from=deps --chown=1001:1001 /opt/app-root/src .
COPY --from=builder --chown=1001:1001 /opt/app-root/src/dist ./dist

ENV NODE_ENV production

# Switch to nodejs user
Expand All @@ -25,9 +27,6 @@ USER 1001
# Install production dependencies
RUN npm ci

COPY --from=builder /opt/app-root/src/dist ./dist
COPY --from=deps /opt/app-root/src .

ENV PORT ${{ values.port }}
EXPOSE ${{ values.port }}

Expand Down

0 comments on commit 3de0a55

Please sign in to comment.