ARG BASE_IMAGE=registry.access.redhat.com/ubi8/nodejs-18 FROM $BASE_IMAGE ARG PORT=8080 # Set Environment Variable ENV PORT=${PORT} # Disable NPM Update Warnings ENV NPM_CONFIG_UPDATE_NOTIFIER=false # Set the Working Directory WORKDIR /ipam # Switch to Root User USER root # Add Application Sources ADD . . # Install Dependencies RUN npm ci # Build Application RUN npm run build # Set Script Execute Permissions RUN chmod +x init.sh RUN rm -rf src RUN chown -R 1001:0 /ipam # Switch to Standard User USER 1001 # Expose Port EXPOSE $PORT # Execute Startup Script ENTRYPOINT ./init.sh ${PORT}