# Use an official Node.js image FROM node:20-slim # The image already has a 'node' user with UID 1000. # Hugging Face requires UID 1000, so we switch to this existing user. USER node ENV HOME=/home/node WORKDIR $HOME/app # Copy configuration files with the correct ownership COPY --chown=node package*.json ./ # Install dependencies RUN npm install # Copy the rest of the application files COPY --chown=node . . # Expose the default port for the API gateway EXPOSE 7860 # Start the Node.js headless server CMD ["node", "server.js"]