Update Dockerfile
Browse files- Dockerfile +52 -19
Dockerfile
CHANGED
|
@@ -1,14 +1,10 @@
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
| 3 |
-
# System
|
| 4 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 5 |
ffmpeg git curl unzip \
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 \
|
| 9 |
-
libgbm1 libasound2 libpangocairo-1.0-0 libpango-1.0-0 \
|
| 10 |
-
libcairo2 libx11-6 libx11-xcb1 libxcb1 libxext6 \
|
| 11 |
-
fonts-liberation libappindicator3-1 xdg-utils wget \
|
| 12 |
&& curl -fsSL https://deno.land/install.sh | sh \
|
| 13 |
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
|
|
@@ -17,26 +13,63 @@ ENV PATH="$DENO_INSTALL/bin:$PATH"
|
|
| 17 |
|
| 18 |
WORKDIR /app
|
| 19 |
|
| 20 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
COPY requirements.txt .
|
| 22 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 23 |
|
| 24 |
-
#
|
| 25 |
-
RUN pip install --no-cache-dir -U "yt-dlp[default
|
| 26 |
-
RUN pip install -
|
| 27 |
-
|
| 28 |
-
# Install Playwright Chromium browser
|
| 29 |
-
RUN playwright install chromium --with-deps
|
| 30 |
|
| 31 |
-
# Copy application files
|
| 32 |
COPY app.py .
|
| 33 |
-
COPY
|
| 34 |
-
COPY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
COPY m_youtube_com_cookies.txt .
|
| 36 |
COPY start.sh .
|
| 37 |
-
|
|
|
|
| 38 |
RUN chmod +x start.sh
|
| 39 |
|
| 40 |
-
|
|
|
|
| 41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
CMD ["./start.sh"]
|
|
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
| 3 |
+
# System deps + deno (yt-dlp JS challenge solver)
|
| 4 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 5 |
ffmpeg git curl unzip \
|
| 6 |
+
libass9 libass-dev \
|
| 7 |
+
fontconfig \
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
&& curl -fsSL https://deno.land/install.sh | sh \
|
| 9 |
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
|
|
|
|
| 13 |
|
| 14 |
WORKDIR /app
|
| 15 |
|
| 16 |
+
# numpy ကို ဦးစွာ install (torch မတိုင်ခင်)
|
| 17 |
+
RUN pip install --no-cache-dir "numpy<2"
|
| 18 |
+
|
| 19 |
+
# torch CPU only
|
| 20 |
+
RUN pip install --no-cache-dir \
|
| 21 |
+
torch==2.2.2+cpu torchaudio==2.2.2+cpu \
|
| 22 |
+
--index-url https://download.pytorch.org/whl/cpu
|
| 23 |
+
|
| 24 |
COPY requirements.txt .
|
| 25 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 26 |
|
| 27 |
+
# yt-dlp latest
|
| 28 |
+
RUN pip install --no-cache-dir -U "yt-dlp[default]"
|
| 29 |
+
RUN pip install faster-whisper
|
| 30 |
+
RUN pip install -U "yt-dlp[default,curl-cffi]"
|
|
|
|
|
|
|
| 31 |
|
| 32 |
+
# Copy all application files (login.html ဖယ်ထုတ်ပြီ — index.html ထဲ ပေါင်းထည့်ပြီးပြီ)
|
| 33 |
COPY app.py .
|
| 34 |
+
COPY run_bot.py .
|
| 35 |
+
COPY bot.py .
|
| 36 |
+
COPY recap_tg_bot.py .
|
| 37 |
+
COPY index.html .
|
| 38 |
+
COPY payment.html .
|
| 39 |
+
COPY payment_history.html .
|
| 40 |
+
COPY privacy.html .
|
| 41 |
+
COPY terms.html .
|
| 42 |
+
COPY NotoSansMyanmar-Bold.ttf .
|
| 43 |
COPY m_youtube_com_cookies.txt .
|
| 44 |
COPY start.sh .
|
| 45 |
+
COPY manifest.json .
|
| 46 |
+
COPY sw.js .
|
| 47 |
RUN chmod +x start.sh
|
| 48 |
|
| 49 |
+
# Create necessary directories
|
| 50 |
+
RUN mkdir -p outputs slips temp_prev temp_thumb temp_
|
| 51 |
|
| 52 |
+
# Install NotoSansMyanmar to system fonts + build isolated fonts.conf
|
| 53 |
+
RUN mkdir -p /usr/local/share/fonts/myanmar \
|
| 54 |
+
&& cp /app/NotoSansMyanmar-Bold.ttf /usr/local/share/fonts/myanmar/ \
|
| 55 |
+
&& fc-cache -fv \
|
| 56 |
+
&& fc-list | grep -i myanmar || true
|
| 57 |
+
|
| 58 |
+
# Write isolated fonts.conf at build time (only Myanmar font dir)
|
| 59 |
+
RUN mkdir -p /app/fc_conf && \
|
| 60 |
+
printf '<?xml version="1.0"?>\n\
|
| 61 |
+
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">\n\
|
| 62 |
+
<fontconfig>\n\
|
| 63 |
+
<dir>/usr/local/share/fonts/myanmar</dir>\n\
|
| 64 |
+
<dir>/app</dir>\n\
|
| 65 |
+
<cachedir>/tmp/fc_cache</cachedir>\n\
|
| 66 |
+
<config><rescan><int>30</int></rescan></config>\n\
|
| 67 |
+
</fontconfig>\n' > /app/fc_conf/fonts.conf
|
| 68 |
+
|
| 69 |
+
# Pre-download Whisper 'tiny' model at build time → no delay on first request
|
| 70 |
+
RUN python -c "import whisper; whisper.load_model('tiny', device='cpu'); print('✅ Whisper tiny model cached')"
|
| 71 |
+
|
| 72 |
+
RUN deno --version && yt-dlp --version && python -c "import numpy; print('numpy', numpy.__version__)"
|
| 73 |
+
|
| 74 |
+
EXPOSE 7860
|
| 75 |
CMD ["./start.sh"]
|