Spaces:
Running
Running
| FROM python:3.11-slim | |
| WORKDIR /app | |
| ENV PYTHONDONTWRITEBYTECODE=1 | |
| ENV PYTHONUNBUFFERED=1 | |
| ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| # Install semua deps Chromium manual (skip playwright install-deps yang broken) | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| # Chromium runtime libs (dari warning playwright) | |
| libglib2.0-0 \ | |
| libnss3 libnspr4 \ | |
| libdbus-1-3 \ | |
| libatk1.0-0 libatk-bridge2.0-0 \ | |
| libcups2 \ | |
| libexpat1 \ | |
| libx11-6 libxcomposite1 libxdamage1 libxext6 libxfixes3 libxrandr2 \ | |
| libgbm1 libxcb1 libxkbcommon0 \ | |
| libpango-1.0-0 libcairo2 \ | |
| libasound2t64 \ | |
| libatspi2.0-0 \ | |
| # Fonts | |
| fonts-liberation \ | |
| fonts-noto \ | |
| fonts-noto-color-emoji \ | |
| fonts-freefont-ttf \ | |
| fonts-unifont \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Python deps | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Install Chromium TANPA --with-deps (deps sudah kita handle manual) | |
| RUN playwright install chromium | |
| COPY . . | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"] | |