FROM node:23-alpine3.21 RUN apk upgrade --update-cache --available ARG VERSION LABEL version=${VERSION}} description="BadgeDex" ENV APP_VERSION=${VERSION} # Create a group and user && Create directory for files RUN mkdir /app && addgroup -S badgedex && adduser -h /app -S badgedex -g "Badgedex User" -G badgedex && chown -R badgedex:badgedex /app && chmod -R 755 /app #Switch to working directory WORKDIR /app # Tell docker that all future commands should run as the appuser user USER badgedex # Bundle app source. Create .dockerignore not copy all files from source directory COPY --chown=badgedex:badgedex . . #Install dependencies RUN npm install # Expose API port EXPOSE 3000 #Start node application ENTRYPOINT ["npm"] CMD [ "start" ]