queen9 / Dockerfile
vish85521's picture
Update Dockerfile
a969597 verified
Raw
History Blame Contribute Delete
492 Bytes
# Use the official Ollama image
FROM ollama/ollama:latest
# 1. Force the port for Hugging Face Spaces
ENV OLLAMA_HOST=0.0.0.0:7860
# 2. Fix the 403 Error by allowing CORS (so your HTML UI works)
ENV OLLAMA_ORIGINS="*"
# 3. Bake the massive 9B model into the image so you don't wait 6 minutes next time
RUN nohup bash -c "ollama serve &" && \
sleep 5 && \
ollama pull qwen2.5:3b && \
pkill ollama
# Expose the port
EXPOSE 7860
# Start the server
ENTRYPOINT ["ollama", "serve"]