Spaces:
Sleeping
Sleeping
| # Use official Node.js 20 image | |
| FROM node:20 | |
| WORKDIR /home/node/app | |
| # Install unzip | |
| RUN apt-get update && apt-get install -y unzip && rm -rf /var/lib/apt/lists/* | |
| # Copy and unzip your archive | |
| COPY --chown=node:node Archive.zip . | |
| RUN unzip Archive.zip -d . && rm Archive.zip | |
| # Set proper ownership | |
| RUN chown -R node:node /home/node/app | |
| # Switch to non-root user | |
| USER node | |
| # Move package.json and package-lock.json from Archive/ to root | |
| RUN mv Archive/package*.json ./ || true | |
| # Install dependencies | |
| RUN npm install | |
| # Copy rest of the files from Archive/ to root | |
| RUN cp -r Archive/* ./ && rm -rf Archive | |
| # Build the Vite app | |
| RUN npm run build | |
| # Expose Hugging Face default port | |
| EXPOSE 7860 | |
| # Start the app | |
| CMD ["npm", "start"] |