# Base image FROM node:22.4.1-alpine RUN apk update && \ apk upgrade && \ apk add ca-certificates curl && \ update-ca-certificates #saudi timezone ENV TZ=Asia/Riyadh # Create app directory RUN mkdir /app && chown node:node /app WORKDIR /app # finally switch user to node USER node # A wildcard is used to ensure both package.json, package-lock.json and package-lock.json are copied COPY --chown=node:node package*.json ./ # Install app dependencies RUN npm install --frozen-lockfile # Bundle app source COPY --chown=node:node . . # Creates a "dist" folder with the production build RUN npm run build # Start the server using the production build CMD [ "node", "dist/main" ]