Skydata001 commited on
Commit
afaa35e
·
verified ·
1 Parent(s): 6f0b383

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -24
Dockerfile CHANGED
@@ -1,30 +1,21 @@
1
- FROM python:3.10-slim
 
2
 
3
- WORKDIR /app
 
4
 
5
- # Install system dependencies
6
- RUN apt-get update && apt-get install -y \
7
- libgl1-mesa-glx \
8
- libglib2.0-0 \
9
- libsm6 \
10
- libxext6 \
11
- libxrender-dev \
12
- libgomp1 \
13
- wget \
14
- git \
15
- && rm -rf /var/lib/apt/lists/*
16
 
17
- # Copy requirements
18
- COPY requirements.txt .
19
- RUN pip install --no-cache-dir -r requirements.txt
20
 
21
- # Download Real-ESRGAN model
22
- RUN mkdir -p weights && \
23
- wget -O weights/RealESRGAN_x4plus.pth https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth
24
 
25
- # Copy application files
26
- COPY . .
27
 
28
- EXPOSE 7860
29
-
30
- CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
 
1
+ # استخدام نسخة بايثون خفيفة
2
+ FROM python:3.9-slim
3
 
4
+ # تعيين مسار العمل
5
+ WORKDIR /code
6
 
7
+ # نسخ ملف المتطلبات وتثبيتها
8
+ COPY ./requirements.txt /code/requirements.txt
9
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
 
 
 
 
 
 
 
 
10
 
11
+ # إنشاء مجلد للملفات المؤقتة
12
+ RUN mkdir -p /code/temp
 
13
 
14
+ # نسخ باقي ملفات المشروع
15
+ COPY . /code
 
16
 
17
+ # إعطاء صلاحيات للمجلد (مهم في Hugging Face)
18
+ RUN chmod -R 777 /code
19
 
20
+ # تشغيل التطبيق على المنفذ 7860 (المنفذ الافتراضي لـ Hugging Face)
21
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]