Spaces:
Runtime error
Runtime error
# 1. Base image with Node.js | |
FROM node:18-alpine | |
# 2. Set working directory inside the container | |
WORKDIR /app | |
# 3. Copy package files and install dependencies | |
COPY package.json package-lock.json* ./ | |
RUN npm install | |
# 4. Copy all other source files | |
COPY . . | |
# 5. Build the Next.js app | |
RUN npm run build | |
# 6. Set environment variable for the custom port | |
ENV PORT=7860 | |
# 7. Expose port 7860 | |
EXPOSE 7860 | |
# 8. Start the Next.js app | |
CMD ["npm", "start"] | |