Spaces:
Running
Running
File size: 629 Bytes
c01243f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
FROM node:18-slim
# Install required system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Change node user ID to match host user ID
RUN usermod -u 1000 node
ARG HF_TOKEN
ENV API_TOKEN=$HF_TOKEN
# Set working directory and ownership
WORKDIR /app
RUN chown -R node:node /app
# Switch to node user
USER node
# Copy package files
COPY --chown=node:node package*.json ./
# Install dependencies
RUN npm install
# Copy the rest of the application
COPY --chown=node:node . .
# Build the Next.js application
RUN npm run build
EXPOSE 3000
CMD ["npm", "start"] |