Spaces:
Sleeping
Sleeping
File size: 707 Bytes
c86dec6 8f06012 7d0cef6 8f06012 c86dec6 8f06012 c86dec6 7d0cef6 c86dec6 8f06012 7d0cef6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | # 1. Base Image
FROM ghcr.io/open-webui/open-webui:main
# 2. Environment Variables
ENV PORT=7860
ENV OLLAMA_BASE_URL=http://127.0.0.1:11434
# 3. Switch to root
USER root
# 4. Install dependencies
RUN apt-get update && apt-get install -y zstd curl
# 5. Install Ollama
RUN curl -fsSL https://ollama.com/install.sh | sh
# 6. Create startup script
RUN echo '#!/bin/bash\n\
set -e\n\
\n\
echo "Starting Ollama..."\n\
ollama serve &\n\
\n\
echo "Waiting for Ollama to be ready..."\n\
until curl -s http://127.0.0.1:11434 > /dev/null; do\n\
sleep 2\n\
done\n\
\n\
echo "Ollama is ready. Starting Open WebUI..."\n\
exec /app/backend/start.sh\n\
' > /start.sh && chmod +x /start.sh
# 7. Run
CMD ["/start.sh"] |