Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- 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.
|
| 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.
|
| 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 |
-
|
|
|
|
|
|
| 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"]
|