# Use official Node.js image FROM node:18-alpine # Set working directory WORKDIR /app # Copy package files first (for better caching) COPY package.json package-lock.json* ./ # Install dependencies (clean & predictable) RUN npm ci --force # Copy the rest of the application COPY . . # Build the application RUN npm run build # Hugging Face Spaces uses PORT env variable ENV PORT=7860 # Expose the port EXPOSE 7860 # Start the preview server CMD ["npm", "run", "preview", "--", "--port", "7860", "--host", "0.0.0.0"]