# Use Node to build and run the app FROM node:22-slim WORKDIR /app # Copy configuration files first to optimize building COPY package*.json ./ # Install the app dependencies RUN npm install # Copy all the remaining project files COPY . . # Build the Lovable frontend RUN npm run build # Expose the precise port Hugging Face requires EXPOSE 7860 # Run a preview server bound to Hugging Face's network configuration CMD ["npm", "run", "preview", "--", "--host", "0.0.0.0", "--port", "7860"]