Spaces:
Paused
Paused
| # Base image Node.js | |
| FROM node:18-slim | |
| # Set workdir | |
| WORKDIR /app | |
| # Install system dependencies (Playwright Chromium + deps) | |
| RUN apt-get update && apt-get install -y \ | |
| wget \ | |
| curl \ | |
| unzip \ | |
| ffmpeg \ | |
| libnss3 \ | |
| libatk1.0-0 \ | |
| libatk-bridge2.0-0 \ | |
| libcups2 \ | |
| libxkbcommon0 \ | |
| libxcomposite1 \ | |
| libxdamage1 \ | |
| libxfixes3 \ | |
| libxrandr2 \ | |
| libgbm1 \ | |
| libasound2 \ | |
| libpangocairo-1.0-0 \ | |
| libpango-1.0-0 \ | |
| libcairo2 \ | |
| libatspi2.0-0 \ | |
| libgtk-3-0 \ | |
| xvfb \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # --- Buat package.json langsung di container --- | |
| RUN npm init -y && \ | |
| npm install express body-parser playwright | |
| # Install Playwright Chromium | |
| RUN npx playwright install --with-deps chromium | |
| USER node | |
| COPY --chown=node . . | |
| # Expose API port | |
| EXPOSE 7860 | |
| # Jalankan server | |
| CMD ["node", "server.js"] |