Spaces:
Paused
Paused
Download Dockerfile from bep40/VNEWS: direct link, hf CLI and curl.
- Browser
- Download file 1.99 kB
-
https://huggingface.co/spaces/bep40/VNEWS/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/bep40/VNEWS/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/bep40/VNEWS/resolve/main/Dockerfile
1.99 kB
| FROM python:3.12-slim | |
| WORKDIR /app | |
| RUN echo "[BUILD] step1: apt-get update+install ffmpeg + Vietnamese fonts" && \ | |
| apt-get update && apt-get install -y --no-install-recommends \ | |
| ffmpeg \ | |
| fonts-dejavu-core \ | |
| fonts-noto \ | |
| fonts-noto-cjk \ | |
| fonts-noto-color-emoji \ | |
| fonts-liberation \ | |
| fonts-freefont-ttf \ | |
| libfreetype6 \ | |
| && rm -rf /var/lib/apt/lists/* && \ | |
| echo "[BUILD] step1 done" | |
| RUN echo "[BUILD] step2: pip base pkgs (bs4/lxml)" && \ | |
| pip install --no-cache-dir "beautifulsoup4>=4.12" lxml && \ | |
| echo "[BUILD] step2 done" | |
| RUN echo "[BUILD] step3: pip main pkgs" && \ | |
| pip install --no-cache-dir fastapi uvicorn requests beautifulsoup4 jinja2 yt-dlp huggingface_hub gTTS pillow edge-tts python-dateutil httpx pycryptodome && \ | |
| echo "[BUILD] step3 done" | |
| COPY requirements.txt . | |
| RUN echo "[BUILD] step4: pip requirements.txt" && \ | |
| pip install --no-cache-dir -r requirements.txt || true && \ | |
| echo "[BUILD] step4 done" | |
| COPY . . | |
| EXPOSE 7860 | |
| RUN echo "[BUILD] step5: setup Vietnamese font symlink" && \ | |
| mkdir -p /usr/share/fonts/truetype/vn && \ | |
| # Prefer Noto Sans for Vietnamese - it has full diacritic support | |
| if [ -f /usr/share/fonts/truetype/noto/NotoSans-Regular.ttf ]; then \ | |
| ln -sf /usr/share/fonts/truetype/noto/NotoSans-Regular.ttf /usr/share/fonts/truetype/vn/VNFont.ttf; \ | |
| elif [ -f /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf ]; then \ | |
| ln -sf /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf /usr/share/fonts/truetype/vn/VNFont.ttf; \ | |
| ln -sf /usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf /usr/share/fonts/truetype/vn/VNFont-Bold.ttf; \ | |
| fi; \ | |
| fc-cache -f -v || true; \ | |
| date > /app/.build_done && \ | |
| echo "[BUILD] step5 done" | |
| CMD ["uvicorn", "_run:app", "--host", "0.0.0.0", "--port", "7860"] | |
| # v3.0-vn-font-fix-short-video-2026-07-19 | |
| # rebuild-trigger: m3u-perf-fix-20260829 | |
| # force-rebuild-20261117-stuck-queued |