FROM node:18-alpine WORKDIR /app # Copy package files COPY package.json package-lock.json* yarn.lock* pnpm-lock.yaml* ./ # Install dependencies RUN npm install --legacy-peer-deps # Copy the entire project COPY . . # Build the Next.js application RUN npm run build # Expose the port EXPOSE 7860 # Start the application on port 7860 for Hugging Face Spaces CMD ["sh", "-c", "npm start -- -p 7860"]