acne / Dockerfile
MohamedTry's picture
Create Dockerfile
3f0548c verified
raw
history blame contribute delete
761 Bytes
FROM python:3.11-slim
# لا تجعل Python يكتب .pyc
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# تثبيت بعض الأدوات الأساسية
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# نسخ requirements
COPY requirements.txt /app/requirements.txt
# تثبيت المتطلبات
RUN pip install --no-cache-dir -r requirements.txt
# نسخ التطبيق
COPY app.py /app/app.py
# المنفذ الافتراضي في Hugging Face Spaces هو 7860 (لكن نحترم متغير PORT لو موجود)
ENV PORT=7860
EXPOSE 7860
# الأمر الذي يشغّل FastAPI
CMD ["bash", "-lc", "uvicorn app:app --host 0.0.0.0 --port ${PORT}"]