File size: 636 Bytes
61652e4 | 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 28 29 | # Use a lightweight Node.js image
FROM node:22-alpine
# Hugging Face Spaces requires apps to run under a non-root user (UID 1000)
# The 'node' user is built into this image with UID 1000
WORKDIR /app
# Copy package files first to leverage Docker cache
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy the rest of your application code
COPY . .
# Grant the 'node' user ownership of the /app directory
RUN chown -R node:node /app
# Switch to the non-root user
USER node
# Hugging Face Spaces route traffic to port 7860 by default
ENV PORT=7860
EXPOSE 7860
# Start the RollyBeans engine
CMD ["node", "index.js"]
|