# Use Node.js 20 base image FROM node:20-slim # Install system dependencies for Playwright RUN apt-get update && apt-get install -y \ libgbm-dev \ libnss3 \ libatk-bridge2.0-0 \ libgtk-3-0 \ libasound2 \ && rm -rf /var/lib/apt/lists/* # Set working directory WORKDIR /app # Copy package files and install dependencies COPY package*.json ./ RUN npm install # Install Playwright browsers RUN npx playwright install --with-deps chromium # Copy the rest of the application code COPY . . # Build the Vite frontend RUN npm run build # Expose the default Hugging Face port EXPOSE 7860 # Set environment variables for production ENV NODE_ENV=production ENV PORT=7860 # Start the server CMD ["node", "server.js"]