Spaces:
Paused
Paused
| FROM node:22.13.1-slim | |
| WORKDIR /usr/src/app | |
| # Install system dependencies for Playwright | |
| RUN apt-get update && apt-get install -y \ | |
| libglib2.0-0 \ | |
| libnspr4 \ | |
| libnss3 \ | |
| libdbus-1-3 \ | |
| libatk1.0-0 \ | |
| libatk-bridge2.0-0 \ | |
| libexpat1 \ | |
| libatspi2.0-0 \ | |
| libx11-6 \ | |
| libxcomposite1 \ | |
| libxdamage1 \ | |
| libxext6 \ | |
| libxfixes3 \ | |
| libxrandr2 \ | |
| libgbm1 \ | |
| libxcb1 \ | |
| libxkbcommon0 \ | |
| libasound2 \ | |
| libgtk-3-0 \ | |
| libpangocairo-1.0-0 \ | |
| libxshmfence1 \ | |
| fonts-liberation \ | |
| libcurl4 \ | |
| ca-certificates \ | |
| && apt-get clean && rm -rf /var/lib/apt/lists/* | |
| # Install pnpm globally | |
| RUN npm install -g pnpm | |
| # Copy files and install Node dependencies | |
| COPY package.json pnpm-lock.yaml* ./ | |
| RUN pnpm install --frozen-lockfile | |
| # Copy source code | |
| COPY . . | |
| # Set HOME to ensure Playwright installs to correct path | |
| ENV HOME=/home/node | |
| # Preinstall Playwright browsers | |
| RUN pnpm exec playwright install | |
| # Build the app | |
| RUN pnpm run build | |
| # Create writable directories | |
| RUN mkdir -p logs etc && chmod 777 logs etc | |
| # Use non-root user to run app | |
| USER node | |
| EXPOSE 7860 | |
| CMD ["pnpm", "run", "start"] | |