Skydata001 commited on
Commit
811c0c0
·
verified ·
1 Parent(s): e01e233

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +31 -26
Dockerfile CHANGED
@@ -1,38 +1,43 @@
1
- FROM nvidia/cuda:12.1.1-runtime-ubuntu22.04
2
 
3
- # تثبيت Python والأدوات الأساسية
4
- RUN apt-get update && apt-get install -y \
5
- python3.10 \
6
- python3-pip \
7
- openjdk-17-jdk \
8
- git \
 
 
9
  wget \
10
  unzip \
11
- zip \
12
- file \
13
- redis-server \
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
- # تثبيت apktool
17
- RUN wget https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/linux/apktool -O /usr/local/bin/apktool \
18
- && chmod +x /usr/local/bin/apktool
19
-
20
- # تثبيت jadx
21
- RUN wget https://github.com/skylot/jadx/releases/download/v1.4.7/jadx-1.4.7.zip -O /tmp/jadx.zip \
22
  && unzip /tmp/jadx.zip -d /opt/jadx \
23
- && chmod +x /opt/jadx/bin/jadx \
24
- && ln -s /opt/jadx/bin/jadx /usr/local/bin/jadx
 
 
 
 
 
 
 
25
 
26
- # تثبيت ripgrep
27
- RUN apt-get update && apt-get install -y ripgrep
 
28
 
29
- # تثبيت Python libraries
30
- WORKDIR /app
31
- COPY requirements.txt .
32
- RUN pip3 install --no-cache-dir -r requirements.txt
33
 
34
- COPY . .
 
35
 
36
  EXPOSE 7860
37
 
38
- CMD ["sh", "-c", "redis-server & python3 app.py"]
 
1
+ FROM python:3.10-slim
2
 
3
+ # منع تفاعلات التثبيت وتحديد المسارات
4
+ ENV DEBIAN_FRONTEND=noninteractive \
5
+ PYTHONUNBUFFERED=1 \
6
+ PATH="/opt/jadx/bin:${PATH}"
7
+
8
+ # تثبيت متطلبات النظام والأدوات الأساسية
9
+ RUN apt-get update && apt-get install -y --no-install-recommends \
10
+ openjdk-17-jre-headless \
11
  wget \
12
  unzip \
13
+ git \
14
+ build-essential \
 
15
  && rm -rf /var/lib/apt/lists/*
16
 
17
+ # تثبيت JADX لتفكيك أكواد DEX إلى Java/Kotlin
18
+ RUN wget https://github.com/skylot/jadx/releases/download/v1.5.0/jadx-1.5.0.zip -O /tmp/jadx.zip \
19
+ && mkdir -p /opt/jadx \
 
 
 
20
  && unzip /tmp/jadx.zip -d /opt/jadx \
21
+ && rm /tmp/jadx.zip \
22
+ && chmod +x /opt/jadx/bin/jadx
23
+
24
+ # إنشاء مستخدم عادي متوافق مع معايير Hugging Face (UID 1000)
25
+ RUN useradd -m -u 1000 user
26
+ USER user
27
+ ENV PATH="/home/user/.local/bin:${PATH}"
28
+
29
+ WORKDIR /home/user/app
30
 
31
+ # تثبيت مكتبات Python
32
+ COPY --chown=user requirements.txt .
33
+ RUN pip install --no-cache-dir -r requirements.txt
34
 
35
+ # نسخ ملفات التطبيق
36
+ COPY --chown=user . .
 
 
37
 
38
+ # إنشاء المجلدات المؤقتة للتخزين
39
+ RUN mkdir -p /tmp/apk_workspace /tmp/apk_output
40
 
41
  EXPOSE 7860
42
 
43
+ CMD ["python", "app.py"]