YouTube / Dockerfile
mohmmed5787's picture
Update Dockerfile
50d3d87 verified
raw
history blame contribute delete
649 Bytes
FROM python:3.12-slim
WORKDIR /app
# نسخ كل شيء أولاً
COPY . .
# البحث عن مجلد frontend ونقله للمسار الرئيسي /app/frontend لضمان وجوده
RUN find . -type d -name "frontend" -exec cp -r {}/ /app/frontend \;
# البحث عن ملف المتطلبات وتثبيته
RUN find . -name "requirements.txt" -exec pip install --no-cache-dir -r {} +
# إنشاء مجلد البيانات
RUN mkdir -p /app/data && chmod 777 /app/data
EXPOSE 7860
# تشغيل التطبيق
CMD ["sh", "-c", "uvicorn $(find . -name main.py | sed 's|./||;s|/|.|g;s|.py||' | head -n 1):app --host 0.0.0.0 --port 7860"]