CoolFace
Apppublic

diamond-in/Next.js

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
Dockerfile39 linesDownload Raw Back to root
1# syntax=docker.io/docker/dockerfile:12 3FROM node:18-alpine AS base4 5# Install dependencies only when needed6FROM base AS deps7# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.8RUN apk add --no-cache libc6-compat9WORKDIR /app10 11# Install dependencies based on the preferred package manager12COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc* ./13# Copy necessary files from the builder stage14# Copy production dependencies15COPY --from=builder /app/node_modules ./node_modules16# Copy the build output (.next folder)17COPY --from=builder /app/.next ./.next18# Copy public assets19COPY --from=builder /app/public ./public20# Copy next.config.js if it exists21COPY --from=builder /app/next.config.js ./next.config.js22 23 24# Set the environment variable for the Next.js port (default is 3000)25# Hugging Face Spaces typically exposes port 7860 for Gradio/Streamlit/etc,26# but for general web apps (like Next.js via the static host option or if you set up a custom server),27# it might expose port 3000 by default when detecting a standard Next.js app.28# It's good practice to set this, but Spaces often handles port mapping.29ENV PORT 300030 31 32# Expose the port the application will run on33EXPOSE 300034 35# Disable Next.js telemetry at runtime36ENV NEXT_TELEMETRY_DISABLED 137 38# Command to run the production Next.js server39CMD ["npm", "start"]