Spaces:
Sleeping
Sleeping
File size: 506 Bytes
e732311 4265217 e732311 4265217 e732311 4265217 e732311 4265217 e732311 4265217 e732311 4265217 e732311 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
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"] |