FROM node:21.7.3 # Create and set the working directory RUN useradd -ms /bin/bash api WORKDIR /home/api # Copy package files and install dependencies COPY package*.json /home/api/ RUN corepack enable pnpm RUN pnpm install # Copy the rest of the application code COPY . . # Build the application if necessary RUN pnpm build # Ensure this command matches your build setup # Switch to the non-root user USER api # Expose the port the app runs on EXPOSE 5001 # Run the application CMD ["pnpm", "start"]