File size: 584 Bytes
b3233cd d438055 548e733 5113237 548e733 7a0df5b 548e733 7a0df5b 548e733 5113237 1411fe8 548e733 5113237 b3233cd 2b66827 5113237 cedcbcd 548e733 5113237 b3233cd | 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 the official Node.js 20 image
FROM node:20-alpine
# Set the working directory
WORKDIR /app
# Update npm to latest version to avoid the "Exit handler never called" error
RUN npm install -g npm@latest
# Copy package.json only (not package-lock.json)
COPY package.json ./
# Clear npm cache and install dependencies fresh
RUN npm cache clean --force && npm install --no-package-lock
# Copy the rest of the application
COPY . .
# Build the Next.js application
RUN npm run build
# Expose Hugging Face default port
EXPOSE 7860
# Start Next.js on port 7860
CMD ["npm", "start"]
|