Spaces:
Sleeping
Sleeping
| # Use Node.js as the base image | |
| FROM node:22-alpine | |
| # Set the working directory | |
| WORKDIR /app | |
| # Copy package files | |
| COPY package*.json ./ | |
| # Install ALL dependencies (including devDependencies like Vite) | |
| # We explicitly set NODE_ENV to development for this step to ensure devDeps are installed | |
| # even if the build environment sets it to production globally. | |
| RUN npm install --include=dev | |
| # Copy the rest of the application code | |
| COPY . . | |
| # Build the application | |
| RUN npm run build | |
| # Install a simple static file server | |
| RUN npm install -g serve | |
| # Expose port 7860 (required by Hugging Face Spaces) | |
| EXPOSE 7860 | |
| # Start the server on port 7860 | |
| CMD ["serve", "-s", "dist", "-l", "7860"] | |