# Use a stable, lightweight Node.js image FROM node:18-alpine # Set the working directory inside the container WORKDIR /app # Explicitly set the port environment variable that Hugging Face expects ENV PORT=7860 # Copy package.json and package-lock.json first to leverage Docker's build cache COPY package*.json ./ # Install only production dependencies to keep the image small RUN npm install --production # Copy the rest of your application code COPY . . # The command to run your application using the standard npm script CMD ["npm", "start"]