File size: 622 Bytes
069b336 9628ed3 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
FROM node:18-slim
WORKDIR /app
# Install dependencies first (for build cache efficiency)
COPY package*.json ./
# Install all dependencies including dev so Vite is available during build and preview
RUN npm install
# Copy the rest of the source code
COPY . .
# Ensure non-root user (UID 1000) can write to the app directory at runtime (HF Spaces runs with uid 1000)
RUN chown -R 1000:1000 /app
# Switch to the non-root user
USER 1000
# Default port for Hugging Face Spaces Docker runtime
ENV PORT 7860
EXPOSE 7860
# Start the app – this script builds then serves via Vite preview on $PORT
CMD ["npm", "run", "dev"] |