# =================================================================== # Open WebUI + llama.cpp # المرحلة الأولى: واجهة تحميل النماذج (model_setup.py) # المرحلة الثانية: llama.cpp + Open WebUI (بعد اختيار النموذج) # =================================================================== FROM ghcr.io/open-webui/open-webui:main # ------------------------------------------------------------------ # متغيرات البيئة # ------------------------------------------------------------------ ENV MODELS_DIR=/data/models ENV DATA_DIR=/data/webui ENV PORT=7860 ENV HOST=0.0.0.0 ENV ENABLE_OLLAMA_API=false ENV ENABLE_OPENAI_API=true ENV OPENAI_API_BASE_URL=http://localhost:8080/v1 ENV OPENAI_API_KEY=sk-llama-cpp-local # ------------------------------------------------------------------ # المتطلبات — libgomp1 فقط (لا حاجة لأدوات بناء) # ------------------------------------------------------------------ RUN apt-get update && apt-get install -y --no-install-recommends \ curl \ libgomp1 \ && rm -rf /var/lib/apt/lists/* # تحديث huggingface_hub للحصول على أمر hf الجديد RUN pip install -U huggingface_hub --no-cache-dir # تثبيت llama-cpp-python من pre-built wheel (ثوانٍ، لا تترجيم) RUN pip install llama-cpp-python[server] \ --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu \ --no-cache-dir # ------------------------------------------------------------------ # ملفات التطبيق # ------------------------------------------------------------------ COPY model_setup.py /app/model_setup.py COPY run.sh /app/run.sh RUN chmod +x /app/run.sh CMD ["/app/run.sh"]