Spaces:
Sleeping
Sleeping
File size: 686 Bytes
ddd4119 f7a5394 ddd4119 d121072 ddd4119 |
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 |
# 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"]
|