norhan12 commited on
Commit
99c7c90
·
verified ·
1 Parent(s): e1c55d7

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -6
Dockerfile CHANGED
@@ -42,19 +42,18 @@ ENV MPLCONFIGDIR=/tmp/matplotlib \
42
  PYTHONUNBUFFERED=1 \
43
  BASE_URL=http://localhost:7860/static/outputs
44
 
45
- # 7. تثبيت بايثون وابديت pip وتحميل dependencies من requirements.txt
46
  USER appuser
47
  RUN pip install --upgrade pip && \
48
  pip install --no-cache-dir -r requirements.txt && \
49
  python -m spacy download en_core_web_sm && \
50
  pip check
51
 
52
- # 8. تعيين healthcheck (اختياري)
53
  HEALTHCHECK --interval=30s --timeout=10s \
54
- CMD curl -f http://localhost:7860/ || exit 1
55
 
56
- # 9. فتح البورت 7860 داخل الكونتينر
57
- EXPOSE 7860
58
 
59
  # 10. تشغيل التطبيق باستخدام uvicorn
60
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
42
  PYTHONUNBUFFERED=1 \
43
  BASE_URL=http://localhost:7860/static/outputs
44
 
45
+ # 7. Install Python dependencies as non-root user
46
  USER appuser
47
  RUN pip install --upgrade pip && \
48
  pip install --no-cache-dir -r requirements.txt && \
49
  python -m spacy download en_core_web_sm && \
50
  pip check
51
 
52
+ # 8. Health check - MODIFIED to use the new /health endpoint
53
  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"]