Spaces:
Build error
Build error
Zerotracex-Stuff commited on
Commit ·
3f7575f
1
Parent(s): df52141
First model version
Browse filesFiles changed (3)
- Dockerfile+23-14
- next.config.ts-1
- package.json+1
1234567891011121314151617181920212223# Use the official Node.js image as the base imageFROM node:20-slim# Set the working directoryWORKDIR /app# Copy package.json and package-lock.json to the working directoryCOPY package*.json ./COPY . .# Install dependenciesRUN npm install# Install a static file serverRUN npm install -g serve# Build and export the Next.js static siteRUN npm run build# Expose the port your app runs on. Use 7860 as per the user's requirement.EXPOSE 7860# Command to serve the static siteCMD ["serve", "-s", "out", "-l", "7860"]1234567891011121314151617181920212223242526272829303132# Use official Node.js image as baseARG BASE=node:20-slimFROM ${BASE} AS baseWORKDIR /app# Copy dependency filesCOPY package.json package-lock.json ./# Install pnpm and dependenciesRUN npm install -g pnpm && pnpm install# Copy the rest of the source codeCOPY . .# Build Next.js appRUN pnpm run build# Production imageFROM base AS productionWORKDIR /app# Set environment variables for Hugging Face SpacesENV PORT=7860 \NODE_ENV=production# Expose the port your app runs onEXPOSE 7860# Start the Next.js appCMD ["pnpm", "start"]
1234567import type {NextConfig} from 'next';const nextConfig: NextConfig = {output: 'export',/* config options here */typescript: {ignoreBuildErrors: true,123456import type {NextConfig} from 'next';const nextConfig: NextConfig = {/* config options here */typescript: {ignoreBuildErrors: true,
123{"name": "nextn","version": "0.1.0",1234{"name": "nextn","version": "0.1.0",
Dockerfile+23-14
next.config.ts-1
package.json+1