Spaces:
Running
Running
| FROM python:3.11-slim | |
| # System deps + deno (yt-dlp JS challenge solver) | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| ffmpeg git curl unzip \ | |
| libass9 libass-dev \ | |
| fontconfig \ | |
| && curl -fsSL https://deno.land/install.sh | sh \ | |
| && rm -rf /var/lib/apt/lists/* | |
| ENV DENO_INSTALL="/root/.deno" | |
| ENV PATH="$DENO_INSTALL/bin:$PATH" | |
| WORKDIR /app | |
| # numpy ကို ဦးစွာ install (torch မတိုင်ခင်) | |
| RUN pip install --no-cache-dir "numpy<2" | |
| # torch CPU only | |
| RUN pip install --no-cache-dir \ | |
| torch==2.2.2+cpu torchaudio==2.2.2+cpu \ | |
| --index-url https://download.pytorch.org/whl/cpu | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # yt-dlp latest | |
| RUN pip install --no-cache-dir -U "yt-dlp[default]" | |
| RUN pip install faster-whisper | |
| RUN pip install -U "yt-dlp[default,curl-cffi]" | |
| # Copy all application files (login.html ဖယ်ထုတ်ပြီ — index.html ထဲ ပေါင်းထည့်ပြီးပြီ) | |
| COPY app.py . | |
| COPY run_bot.py . | |
| COPY bot.py . | |
| COPY index.html . | |
| COPY payment.html . | |
| COPY payment_history.html . | |
| COPY privacy.html . | |
| COPY terms.html . | |
| COPY NotoSansMyanmar-Bold.ttf . | |
| COPY m_youtube_com_cookies.txt . | |
| COPY start.sh . | |
| COPY manifest.json . | |
| COPY sw.js . | |
| RUN chmod +x start.sh | |
| # Create necessary directories | |
| RUN mkdir -p outputs slips temp_prev temp_thumb temp_ | |
| # Install NotoSansMyanmar to system fonts + build isolated fonts.conf | |
| RUN mkdir -p /usr/local/share/fonts/myanmar \ | |
| && cp /app/NotoSansMyanmar-Bold.ttf /usr/local/share/fonts/myanmar/ \ | |
| && fc-cache -fv \ | |
| && fc-list | grep -i myanmar || true | |
| # Write isolated fonts.conf at build time (only Myanmar font dir) | |
| RUN mkdir -p /app/fc_conf && \ | |
| printf '<?xml version="1.0"?>\n\ | |
| <!DOCTYPE fontconfig SYSTEM "fonts.dtd">\n\ | |
| <fontconfig>\n\ | |
| <dir>/usr/local/share/fonts/myanmar</dir>\n\ | |
| <dir>/app</dir>\n\ | |
| <cachedir>/tmp/fc_cache</cachedir>\n\ | |
| <config><rescan><int>30</int></rescan></config>\n\ | |
| </fontconfig>\n' > /app/fc_conf/fonts.conf | |
| # Pre-download Whisper 'tiny' model at build time → no delay on first request | |
| RUN python -c "import whisper; whisper.load_model('tiny', device='cpu'); print('✅ Whisper tiny model cached')" | |
| RUN deno --version && yt-dlp --version && python -c "import numpy; print('numpy', numpy.__version__)" | |
| EXPOSE 7860 | |
| CMD ["./start.sh"] | |