Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files4 unmodified lines567891011121314151617181920212223242526272829303132333435363738394 unmodified linesbuild-essential \&& rm -rf /var/lib/apt/lists/*ARG HF_TOKENENV API_TOKEN=$HF_TOKEN# Create app directory and set permissionsWORKDIR /app# Create a non-root userRUN addgroup --system --gid 1001 nodejs && \adduser --system --uid 1001 nextjs && \chown -R nextjs:nodejs /app# Copy package filesCOPY --chown=nextjs:nodejs package*.json ./# Install dependenciesRUN npm install# Copy the rest of the applicationCOPY --chown=nextjs:nodejs . .# Switch to non-root userUSER nextjs# Build the Next.js applicationRUN npm run build# Expose the port the app runs onEXPOSE 3001# Start the applicationCMD ["npm", "start"]4 unmodified lines5678910111213141516171819202122232425262728293031323334354 unmodified linesbuild-essential \&& rm -rf /var/lib/apt/lists/*# Change node user ID to match host user IDRUN usermod -u 1000 nodeARG HF_TOKENENV API_TOKEN=$HF_TOKEN# Set working directory and ownershipWORKDIR /appRUN chown -R node:node /app# Switch to node userUSER node# Copy package filesCOPY --chown=node:node package*.json ./# Install dependenciesRUN npm install# Copy the rest of the applicationCOPY --chown=node:node . .# Build the Next.js applicationRUN npm run buildEXPOSE 3001CMD ["npm", "start"]
Dockerfile+9-13