Download Dockerfile from ttttdiva/get_mhtml: direct link, hf CLI and curl.
- Browser
- Download file 1.19 kB
-
https://huggingface.co/spaces/ttttdiva/get_mhtml/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/ttttdiva/get_mhtml/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/ttttdiva/get_mhtml/resolve/main/Dockerfile
1.19 kB
| FROM python:3.9 | |
| # 1) システム更新 & Playwrightで必要そうなライブラリをまとめて入れる | |
| # rclone, aria2, zip は不要とのことなので削除 | |
| RUN apt-get update && apt-get install -y \ | |
| libnss3 \ | |
| libatk1.0-0 \ | |
| libatk-bridge2.0-0 \ | |
| libcups2 \ | |
| libdrm2 \ | |
| libxkbcommon0 \ | |
| libwayland-egl1 \ | |
| libwayland-cursor0 \ | |
| libwayland-server0 \ | |
| libgbm1 \ | |
| fonts-liberation \ | |
| libasound2 \ | |
| # ↑Playwrightに必要 | |
| && rm -rf /var/lib/apt/lists/* | |
| # 2) /code ディレクトリを作業場所に | |
| WORKDIR /code | |
| # 3) requirements.txt をコピーし、Pythonパッケージをインストール | |
| COPY requirements.txt /code/requirements.txt | |
| RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt | |
| # 4) Hugging Face Spaces の実行ユーザー(1000:user)を作成して切り替え | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH | |
| # 5) 作業ディレクトリを "/home/user/app" に設定 | |
| WORKDIR $HOME/app | |
| # 6) ソースコードをコピー | |
| COPY --chown=user . $HOME/app | |
| # 7) 起動コマンド | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |