Spaces:
Build error
Build error
| FROM node:18-slim | |
| # Use the existing node user (UID 1000) | |
| USER node | |
| # Set environment variables | |
| ENV HOME=/home/node \ | |
| PATH=/home/node/.local/bin:$PATH | |
| # Set working directory | |
| WORKDIR /home/node/app | |
| # Copy package files with proper ownership | |
| COPY --chown=node:node package*.json ./ | |
| # Install dependencies | |
| RUN npm install | |
| # Copy rest of the application with proper ownership | |
| COPY --chown=node:node . . | |
| # Build the Next.js app | |
| RUN npm run build | |
| # Expose port 7860 | |
| EXPOSE 7860 | |
| # Start the application on port 7860 | |
| CMD ["npm", "start", "--", "-p", "7860"] |