File size: 2,544 Bytes
b2ae30c
5aef002
d636ce5
b6c92a7
aae7a51
d636ce5
 
aae7a51
5aef002
 
aae7a51
 
 
2f440a2
5aef002
d636ce5
aae7a51
 
 
 
 
 
 
2f440a2
fd36f86
5aef002
f4221db
 
 
 
4074219
d636ce5
b6c92a7
8f5a5ec
aae7a51
8bafa17
6a4d60d
091aaca
 
57223a3
 
821371a
b792579
aae7a51
85d0625
c179456
aae7a51
 
d636ce5
 
091aaca
d636ce5
aae7a51
821371a
d636ce5
 
821371a
d636ce5
821371a
 
 
 
 
 
 
 
 
70f9ba7
d636ce5
 
a46d08e
1db2a58
bbeead4
aae7a51
a88e8fb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
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 (force fresh — no cache, so rebuild always pulls newest extractor fixes)
RUN pip install --no-cache-dir --upgrade --force-reinstall "yt-dlp[default]"
RUN pip install --no-cache-dir faster-whisper
RUN pip install --no-cache-dir --upgrade --force-reinstall "yt-dlp[default,curl-cffi]"

# Copy all application files (login.html ဖယ်ထုတ်ပြီ — index.html ထဲ ပေါင်းထည့်ပြီးပြီ)
COPY app.py .
COPY run_bot.py .
COPY bot.py .
COPY recap_tg_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"]