Skip to content

Commit

Permalink
base linux image update
Browse files Browse the repository at this point in the history
  • Loading branch information
TimCsaky committed Nov 4, 2024
1 parent a4f5c54 commit d5443cc
Showing 1 changed file with 14 additions and 28 deletions.
42 changes: 14 additions & 28 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,34 +1,20 @@
# FROM docker.io/node:16.15.0-alpine # Last known working alpine image
FROM docker.io/node:20.15.1-alpine3.20

# RedHat Image Catalog references
# https://catalog.redhat.com/software/containers/ubi9/nodejs-18/62e8e7ed22d1d3c2dfe2ca01
# https://catalog.redhat.com/software/containers/ubi9/nodejs-18-minimal/62e8e919d4f57d92a9dee838

#
# Build the application
#
FROM registry.access.redhat.com/ubi9/nodejs-18:1-35 as builder

ENV NO_UPDATE_NOTIFIER=true
ARG APP_ROOT=/opt/app-root/src
ENV APP_PORT=8080 \
NO_UPDATE_NOTIFIER=true
WORKDIR ${APP_ROOT}

USER 0
COPY . /tmp/src
WORKDIR /tmp/src/app
RUN chown -R 1001:0 /tmp/src
# NPM Permission Fix
RUN mkdir -p /.npm
RUN chown -R 1001:0 /.npm

# Install Application
COPY . ${APP_ROOT}
RUN chown -R 1001:0 ${APP_ROOT}
USER 1001
RUN npm ci

#
# Create the final container image
#
FROM registry.access.redhat.com/ubi9/nodejs-18-minimal:1-36

ENV APP_PORT=3000 \
NO_UPDATE_NOTIFIER=true

COPY --from=builder /tmp/src ${HOME}
WORKDIR ${HOME}/app
WORKDIR ${APP_ROOT}/app
RUN npm ci --omit=dev

EXPOSE ${APP_PORT}
CMD ["npm", "run", "start"]
CMD ["node", "./bin/www"]

0 comments on commit d5443cc

Please sign in to comment.