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