Spaces:
Sleeping
Sleeping
File size: 556 Bytes
75a5b3f 3a8b452 75a5b3f 3a8b452 75a5b3f 3a8b452 75a5b3f 3a8b452 75a5b3f 3a8b452 75a5b3f 3a8b452 75a5b3f 3a8b452 | 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 26 27 |
# Use a slim version of Node.js for a smaller image size
FROM node:20-slim
# Set the working directory
WORKDIR /app
# Create a non-root user with UID 1000 (Hugging Face requirement)
RUN useradd -m -u 1560 user
# Copy package files and install dependencies
COPY --chown=user package*.json ./
RUN npm install
# Copy the rest of the application code
COPY --chown=user . .
# Switch to the non-root user
USER user
# Set environment variables (Hugging Face default port is 7860)
ENV PORT=7860
EXPOSE 7860
# Start the application
CMD ["node", "index.js"]
|