Download Dockerfile from Cauanne/Checkerv5: direct link, hf CLI and curl.
- Browser
- Download file 1.37 kB
-
https://huggingface.co/spaces/Cauanne/Checkerv5/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Cauanne/Checkerv5/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Cauanne/Checkerv5/resolve/main/Dockerfile
1.37 kB
| FROM python:3.9-slim | |
| # 1. Instalar dependências do sistema como ROOT | |
| # Incluindo todas as dependências que o Playwright normalmente instalaria com --with-deps | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| python3-dev \ | |
| libffi-dev \ | |
| libssl-dev \ | |
| wget \ | |
| gnupg \ | |
| ca-certificates \ | |
| libglib2.0-0 \ | |
| libnss3 \ | |
| libnspr4 \ | |
| libatk1.0-0 \ | |
| libatk-bridge2.0-0 \ | |
| libcups2 \ | |
| libdrm2 \ | |
| libdbus-1-3 \ | |
| libxcb1 \ | |
| libxkbcommon0 \ | |
| libx11-6 \ | |
| libxcomposite1 \ | |
| libxdamage1 \ | |
| libxext6 \ | |
| libxfixes3 \ | |
| libxrandr2 \ | |
| libgbm1 \ | |
| libpango-1.0-0 \ | |
| libcairo2 \ | |
| libasound2 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # 2. Configurar usuário não-root (Obrigatório para Hugging Face) | |
| RUN useradd -m -u 1000 user | |
| WORKDIR /home/user/app | |
| # 3. Instalar requisitos Python como usuário comum | |
| COPY --chown=user requirements.txt . | |
| RUN pip install --no-cache-dir --upgrade pip && \ | |
| pip install --no-cache-dir -r requirements.txt | |
| # 4. Instalar o navegador Chromium SEM o flag --with-deps | |
| # (pois já instalamos as dependências acima como root) | |
| RUN python3 -m playwright install chromium | |
| # 5. Copiar o restante do código | |
| COPY --chown=user . . | |
| # Mudar para o usuário não-root antes de rodar | |
| USER user | |
| ENV PATH="/home/user/.local/bin:${PATH}" | |
| EXPOSE 7860 | |
| CMD ["python3", "app.py"] | |