Download Dockerfile from p0000000/test: direct link, hf CLI and curl.
- Browser
- Download file 1.92 kB
-
https://huggingface.co/spaces/p0000000/test/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/p0000000/test/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/p0000000/test/resolve/main/Dockerfile
1.92 kB
| # Lire la doc officielle : https://huggingface.co/docs/hub/spaces-sdks-docker | |
| FROM python:3.9 | |
| # Installer les dépendances système nécessaires à Playwright avant de passer en user non root | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| libnss3 \ | |
| libdbus-1-3 \ | |
| libatk1.0-0 \ | |
| libatk-bridge2.0-0 \ | |
| libcups2 \ | |
| libxkbcommon0 \ | |
| libatspi2.0-0 \ | |
| libxcomposite1 \ | |
| libxdamage1 \ | |
| libxfixes3 \ | |
| libxrandr2 \ | |
| libgbm1 \ | |
| libasound2 \ | |
| curl \ | |
| && apt-get clean && rm -rf /var/lib/apt/lists/* | |
| # Ajout d'un utilisateur non-root | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| WORKDIR /app | |
| # Copier requirements et installer les dépendances python | |
| COPY --chown=user ./requirements.txt requirements.txt | |
| RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
| # Installer les navigateurs Playwright avec dépendances user-level | |
| RUN playwright install --with-deps | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| libnss3 \ | |
| libdbus-1-3 \ | |
| libatk1.0-0 \ | |
| libatk-bridge2.0-0 \ | |
| libcups2 \ | |
| libxkbcommon0 \ | |
| libatspi2.0-0 \ | |
| libxcomposite1 \ | |
| libxdamage1 \ | |
| libxfixes3 \ | |
| libxrandr2 \ | |
| libgbm1 \ | |
| libasound2 \ | |
| curl \ | |
| && apt-get clean && rm -rf /var/lib/apt/lists/* | |
| # Copier le reste de l'application | |
| COPY --chown=user . /app | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |
| # Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker | |
| # you will also find guides on how best to write your Dockerfile | |
| FROM python:3.9 | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| WORKDIR /app | |
| COPY --chown=user ./requirements.txt requirements.txt | |
| RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
| COPY --chown=user . /app | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |