Download Dockerfile from matt1847/will: direct link, hf CLI and curl.
- Browser
- Download file 577 Bytes
-
https://huggingface.co/spaces/matt1847/will/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/matt1847/will/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/matt1847/will/resolve/main/Dockerfile
577 Bytes
| FROM python:3.11-slim | |
| WORKDIR /app | |
| # 依存関係のインストール | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # モデルの事前ダウンロード(ビルド時にキャッシュ) | |
| RUN python -c "from transformers import GPT2LMHeadModel, GPT2Tokenizer; \ | |
| GPT2LMHeadModel.from_pretrained('gpt2'); \ | |
| GPT2Tokenizer.from_pretrained('gpt2')" | |
| # アプリケーションコードをコピー | |
| COPY app.py . | |
| COPY src/ ./src/ | |
| EXPOSE 8501 | |
| CMD ["streamlit", "run", "app.py", "--server.headless", "true", "--server.address", "0.0.0.0"] | |