Spaces:
Sleeping
Sleeping
| # Use Node.js 18 as the base image (compatible with Next.js 15) | |
| FROM node:18-slim | |
| # Install required system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| && rm -rf /var/lib/apt/lists/* | |
| ARG HF_TOKEN | |
| ENV NEXT_PUBLIC_HUGGINGFACE_API_KEY=$HF_TOKEN | |
| ENV PORT=7860 | |
| ENV NODE_ENV=production | |
| # Set working directory | |
| WORKDIR /app | |
| # Copy package files | |
| COPY package*.json ./ | |
| # Install dependencies | |
| RUN npm install | |
| # Copy the rest of the application | |
| COPY . . | |
| # Build the Next.js application | |
| # Note: We don't use turbopack for production builds | |
| RUN npm run build | |
| EXPOSE 7860 | |
| CMD ["npm", "start", "--", "-p", "7860"] |