Download Dockerfile from hashim1/flask: direct link, hf CLI and curl.
- Browser
- Download file 835 Bytes
-
https://huggingface.co/spaces/hashim1/flask/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/hashim1/flask/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/hashim1/flask/resolve/main/Dockerfile
835 Bytes
| FROM python:3.9 | |
| # إنشاء مستخدم جديد لتشغيل التطبيق | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| WORKDIR /app | |
| # نسخ ملف requirements.txt و تثبيت المتطلبات | |
| COPY --chown=user ./requirements.txt requirements.txt | |
| RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
| # نسخ الكود البرمجي وكل المجلدات إلى الحاوية | |
| COPY --chown=user . /app | |
| # نسخ المجلدات الخاصة بالقوالب (templates) والملفات الثابتة (static) إلى الحاوية | |
| COPY --chown=user ./templates /app/templates | |
| COPY --chown=user ./static /app/static | |
| COPY --chown=user ./instance /app/instance | |
| # استخدم gunicorn لتشغيل تطبيق Flask | |
| CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "app:app"] | |