norhan12 commited on
Commit
b47e7e9
·
verified ·
1 Parent(s): 4c8be03

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +1 -8
Dockerfile CHANGED
@@ -1,6 +1,5 @@
1
  FROM python:3.10-slim
2
 
3
- # 1. تثبيت dependencies النظامية المطلوبة
4
  RUN apt-get update && apt-get install -y \
5
  libsndfile1 \
6
  ffmpeg \
@@ -13,10 +12,8 @@ RUN apt-get update && apt-get install -y \
13
  build-essential \
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
- # 2. إنشاء مستخدم غير root
17
  RUN useradd -m appuser
18
 
19
- # 3. إنشاء المجلدات المطلوبة مع تعيين الصلاحيات
20
  RUN mkdir -p \
21
  /tmp/matplotlib \
22
  /tmp/fontconfig \
@@ -28,19 +25,16 @@ RUN mkdir -p \
28
  /app/static/outputs && \
29
  chown -R appuser:appuser /app /tmp/matplotlib /tmp/fontconfig /tmp/lhotse
30
 
31
- # 4. تعيين مجلد العمل
32
  WORKDIR /app
33
 
34
- # 5. نسخ ملفات التطبيق إلى المجلد داخل الكونتينر مع تعيين صلاحيات اليوزر
35
  COPY --chown=appuser:appuser . .
36
 
37
- # 6. ضبط متغيرات البيئة
38
  ENV MPLCONFIGDIR=/tmp/matplotlib \
39
  FONTCONFIG_PATH=/tmp/fontconfig \
40
  LHOTSE_CACHE_DIR=/tmp/lhotse \
41
  HF_HUB_ENABLE_HF_TRANSFER=1 \
42
  PYTHONUNBUFFERED=1 \
43
- BASE_URL=http://localhost:7860/static/outputs
44
 
45
  # 7. Install Python dependencies as non-root user
46
  USER appuser
@@ -54,6 +48,5 @@ HEALTHCHECK --interval=30s --timeout=10s \
54
  CMD curl -f http://localhost:7860/health || exit 1
55
 
56
 
57
- # 10. تشغيل التطبيق باستخدام uvicorn
58
  # 9. Run the application - MODIFIED to use Uvicorn for FastAPI
59
  CMD ["python", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.10-slim
2
 
 
3
  RUN apt-get update && apt-get install -y \
4
  libsndfile1 \
5
  ffmpeg \
 
12
  build-essential \
13
  && rm -rf /var/lib/apt/lists/*
14
 
 
15
  RUN useradd -m appuser
16
 
 
17
  RUN mkdir -p \
18
  /tmp/matplotlib \
19
  /tmp/fontconfig \
 
25
  /app/static/outputs && \
26
  chown -R appuser:appuser /app /tmp/matplotlib /tmp/fontconfig /tmp/lhotse
27
 
 
28
  WORKDIR /app
29
 
 
30
  COPY --chown=appuser:appuser . .
31
 
 
32
  ENV MPLCONFIGDIR=/tmp/matplotlib \
33
  FONTCONFIG_PATH=/tmp/fontconfig \
34
  LHOTSE_CACHE_DIR=/tmp/lhotse \
35
  HF_HUB_ENABLE_HF_TRANSFER=1 \
36
  PYTHONUNBUFFERED=1 \
37
+
38
 
39
  # 7. Install Python dependencies as non-root user
40
  USER appuser
 
48
  CMD curl -f http://localhost:7860/health || exit 1
49
 
50
 
 
51
  # 9. Run the application - MODIFIED to use Uvicorn for FastAPI
52
  CMD ["python", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]