| # Single stage build for Hugging Face Spaces | |
| FROM node:18-alpine | |
| # Set working directory | |
| WORKDIR /app | |
| # Copy package files | |
| COPY package*.json ./ | |
| # Install dependencies with legacy peer deps to avoid conflicts | |
| RUN npm install --legacy-peer-deps --production=false | |
| # Copy all application files | |
| COPY . . | |
| # Build the Next.js application | |
| RUN npm run build | |
| # Create public directory if it doesn't exist | |
| RUN mkdir -p public | |
| # Expose port 7860 for Hugging Face Spaces | |
| EXPOSE 7860 | |
| # Set environment variables | |
| ENV NODE_ENV=production | |
| ENV PORT=7860 | |
| ENV HOSTNAME=0.0.0.0 | |
| ENV NEXT_TELEMETRY_DISABLED=1 | |
| # Start the application | |
| CMD ["npm", "start"] |