Opera8 commited on
Commit
1f5e1e1
·
verified ·
1 Parent(s): e425c86

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -17
Dockerfile CHANGED
@@ -1,41 +1,40 @@
1
  FROM python:3.10-slim
2
 
3
- # نصب FFmpeg و ابزارهای دانلود
 
4
  RUN apt-get update && \
5
- apt-get install -y ffmpeg wget fontconfig && \
6
  rm -rf /var/lib/apt/lists/*
7
 
8
- # --- نصب فونت‌ها در مسیر اختصاصی ---
9
  RUN mkdir -p /usr/share/fonts/truetype/custom
10
 
11
- # 1. دانلود وزیرمتن (سرور JsDelivr - وضعیت: سالم)
12
- RUN wget "https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/ttf/Vazirmatn-Bold.ttf" -O /usr/share/fonts/truetype/custom/Vazirmatn.ttf
13
 
14
- # 2. دانلود لاله زار (سرور JsDelivr - وضعیت: سالم)
15
- RUN wget "https://cdn.jsdelivr.net/gh/google/fonts@main/ofl/lalezar/Lalezar-Regular.ttf" -O /usr/share/fonts/truetype/custom/Lalezar.ttf
16
 
17
- # 3. دانلود Roboto (سرور CDNJS - وضعیت: عالی و پایدار)
18
- RUN wget "https://cdnjs.cloudflare.com/ajax/libs/roboto-fontface/0.10.0/fonts/roboto/Roboto-Bold.ttf" -O /usr/share/fonts/truetype/custom/Roboto.ttf
19
 
20
- # 4. دانلود Bangers (سرور Raw GitHub - وضعیت: سالم)
21
- RUN wget "https://raw.githubusercontent.com/google/fonts/main/ofl/bangers/Bangers-Regular.ttf" -O /usr/share/fonts/truetype/custom/Bangers.ttf
 
 
22
 
23
- # به روز رسانی کش فونت‌ها
24
  RUN fc-cache -fv
25
 
26
  WORKDIR /app
27
 
28
- # ساخت پوشه‌های مورد نیاز
29
  RUN mkdir -p /app/static /app/temp
30
 
31
- # نصب پکیج‌های پایتون
32
  COPY requirements.txt .
33
  RUN pip install --no-cache-dir -r requirements.txt
34
 
35
- # کپی کدها
36
  COPY . .
37
-
38
- # تنظیم دسترسی برای هاگینگ فیس
39
  RUN chmod -R 777 /app
40
 
41
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.10-slim
2
 
3
+ # نصب FFmpeg، ابزارهای دانلود و فونت روبوتو از مخزن رسمی لینوکس
4
+ # (نصب fonts-roboto تضمین می‌کند که این فونت همیشه موجود است)
5
  RUN apt-get update && \
6
+ apt-get install -y ffmpeg wget fontconfig fonts-roboto && \
7
  rm -rf /var/lib/apt/lists/*
8
 
9
+ # --- نصب فونت‌های سفارشی ---
10
  RUN mkdir -p /usr/share/fonts/truetype/custom
11
 
12
+ # 1. فارسی: وزیرمتن (لینک مستقیم گیت‌هاب)
13
+ RUN wget "https://github.com/rastikerdar/vazirmatn/raw/master/fonts/ttf/Vazirmatn-Bold.ttf" -O /usr/share/fonts/truetype/custom/Vazirmatn.ttf
14
 
15
+ # 2. فارسی: لاله زار (لینک مستقیم گیت‌هاب)
16
+ RUN wget "https://github.com/google/fonts/raw/main/ofl/lalezar/Lalezar-Regular.ttf" -O /usr/share/fonts/truetype/custom/Lalezar.ttf
17
 
18
+ # 3. انگلیسی: Bangers (لینک مستقیم گیت‌هاب)
19
+ RUN wget "https://github.com/google/fonts/raw/main/ofl/bangers/Bangers-Regular.ttf" -O /usr/share/fonts/truetype/custom/Bangers.ttf
20
 
21
+ # نکته: فونت Roboto چون با apt نصب شده، خودکار شناسایی می‌شود
22
+ # اما برای اطمینان، یک کپی از آن را در پوشه کاستوم هم می‌گذاریم
23
+ RUN cp /usr/share/fonts/truetype/roboto/hinted/Roboto-Bold.ttf /usr/share/fonts/truetype/custom/Roboto.ttf || \
24
+ cp /usr/share/fonts/truetype/roboto/unhinted/Roboto-Bold.ttf /usr/share/fonts/truetype/custom/Roboto.ttf
25
 
26
+ # کش کردن فونت‌ها
27
  RUN fc-cache -fv
28
 
29
  WORKDIR /app
30
 
31
+ # ساخت پوشه‌ها
32
  RUN mkdir -p /app/static /app/temp
33
 
 
34
  COPY requirements.txt .
35
  RUN pip install --no-cache-dir -r requirements.txt
36
 
 
37
  COPY . .
 
 
38
  RUN chmod -R 777 /app
39
 
40
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]