File size: 1,538 Bytes
2da9ec1
 
58842a4
2da9ec1
58842a4
2da9ec1
 
1f5e1e1
0ed3ea4
 
58842a4
1f5e1e1
618b836
58842a4
1f5e1e1
0ed3ea4
58842a4
1f5e1e1
618b836
58842a4
 
 
682dcb4
1f5e1e1
682dcb4
 
2da9ec1
 
1f5e1e1
682dcb4
a203794
2da9ec1
 
 
 
 
 
 
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
FROM python:3.10-slim

# نصب FFmpeg و فونت‌های سیستمی (شامل Roboto)
RUN apt-get update && \
    apt-get install -y ffmpeg wget fontconfig fonts-roboto && \
    rm -rf /var/lib/apt/lists/*

# --- نصب فونت‌های سفارشی ---
RUN mkdir -p /usr/share/fonts/truetype/custom

# 1. فارسی: وزیرمتن (لینک مستقیم Raw GitHub)
RUN wget "https://github.com/rastikerdar/vazirmatn/raw/master/fonts/ttf/Vazirmatn-Bold.ttf" -O /usr/share/fonts/truetype/custom/Vazirmatn.ttf

# 2. فارسی: لاله زار (لینک مستقیم Raw GitHub)
RUN wget "https://github.com/google/fonts/raw/main/ofl/lalezar/Lalezar-Regular.ttf" -O /usr/share/fonts/truetype/custom/Lalezar.ttf

# 3. انگلیسی: Bangers (لینک مستقیم Raw GitHub)
RUN wget "https://github.com/google/fonts/raw/main/ofl/bangers/Bangers-Regular.ttf" -O /usr/share/fonts/truetype/custom/Bangers.ttf

# 4. انگلیسی: Roboto (کپی از فونت‌های نصب شده سیستمی)
# ما پکیج fonts-roboto را بالا نصب کردیم، حالا فایل آن را پیدا و کپی می‌کنیم
RUN find /usr/share/fonts -name "Roboto-Bold.ttf" -exec cp {} /usr/share/fonts/truetype/custom/Roboto.ttf \;

# کش کردن فونت‌ها
RUN fc-cache -fv

WORKDIR /app

# ساخت پوشه‌ها
RUN mkdir -p /app/static /app/temp

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .
RUN chmod -R 777 /app

CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]