FROM node:18-slim # The node:18-slim image already has a user with UID 1000 (node) # We'll use that user instead of creating a new one USER node # Set home to the node user's home directory ENV HOME=/home/node \ PATH=/home/node/.local/bin:$PATH # Set the working directory WORKDIR $HOME/app # Copy package files with proper ownership COPY --chown=node package*.json ./ # Install dependencies RUN npm install # Copy application files with proper ownership COPY --chown=node proxy.js ./ COPY --chown=node README.md ./ # Expose port 7860 (HF Spaces default) EXPOSE 7860 # Start the application CMD ["node", "proxy.js"]