Spaces:
Sleeping
Sleeping
Download Dockerfile from ihhereanth/roblox-npc-api: direct link, hf CLI and curl.
- Browser
- Download file 896 Bytes
-
https://huggingface.co/spaces/ihhereanth/roblox-npc-api/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/ihhereanth/roblox-npc-api/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/ihhereanth/roblox-npc-api/resolve/main/Dockerfile
896 Bytes
| FROM python:3.11-slim | |
| # HF Docker Space รันเป็น UID 1000 ไม่ใช่ root — ต้องสร้าง user ก่อน | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH \ | |
| HF_HOME=/home/user/.cache/huggingface \ | |
| PYTHONUNBUFFERED=1 \ | |
| PYTHONDONTWRITEBYTECODE=1 | |
| WORKDIR $HOME/app | |
| COPY --chown=user requirements.txt . | |
| RUN pip install --no-cache-dir --upgrade pip && \ | |
| pip install --no-cache-dir -r requirements.txt | |
| # warm cache ในฐานะ user 1000 — ล้มเหลวก็ไม่พัง build | |
| RUN python -c "from transformers import AutoTokenizer; \ | |
| AutoTokenizer.from_pretrained('Qwen/Qwen3-30B-A3B-Instruct-2507')" \ | |
| || echo "tokenizer warm-up skipped" | |
| COPY --chown=user . . | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"] |