Spaces:
Sleeping
Sleeping
File size: 488 Bytes
160d275 9d644cd 160d275 9d644cd 160d275 9d644cd 160d275 9d644cd 160d275 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | FROM node:20-alpine
# Set up the working directory inside the pre-existing node user's home
WORKDIR /home/node/app
# Copy dependency configs and adjust ownership to the 'node' user
COPY --chown=node:node package*.json ./
RUN npm install
# Copy the rest of your server code
COPY --chown=node:node . .
# Switch to the non-root node user for Hugging Face security
USER node
# Expose the mandatory Hugging Face port
EXPOSE 7860
ENV PORT=7860
CMD ["node", "server.js"] |