| # Gunakan Playwright image | |
| FROM mcr.microsoft.com/playwright:focal | |
| # Set environment variable untuk menghindari Playwright dialog | |
| ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD 1 | |
| # Install FFmpeg | |
| RUN apt-get update && apt-get install -y ffmpeg | |
| # Pindah ke root sebelum clone agar tidak ada konflik dengan WORKDIR | |
| WORKDIR / | |
| # Clone repo dengan authentication tanpa cache | |
| RUN --mount=type=secret,id=GITHUB_REPO,required=true \ | |
| rm -rf /app && mkdir -p /app && git clone $(cat /run/secrets/GITHUB_REPO) /app | |
| # Set work directory ke /app setelah clone | |
| WORKDIR /app | |
| # Install dependencies | |
| RUN npm install | |
| # Install Playwright dependencies dan browser binaries | |
| RUN npx playwright install --with-deps | |
| # Expose port aplikasi | |
| EXPOSE 7860 | |
| # Jalankan aplikasi | |
| CMD ["npm", "start"] | |