File size: 511 Bytes
7a1bbfe 0b320b6 8e1e243 7a1bbfe 8e1e243 7a1bbfe 0b320b6 8e1e243 7a1bbfe 8e1e243 7a1bbfe 739ea7e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # Use the official minimal Alpine Ollama image [2]
FROM ollama/ollama:latest
# Set environment variables for Ollama
ENV OLLAMA_HOST=0.0.0.0:7860
ENV OLLAMA_MODELS=/root/.ollama/models
ENV OLLAMA_KEEP_ALIVE=-1
# Expose the default Ollama port [15]
EXPOSE 7860
# Start ollama, pull the model, then keep the container running
# Note: Using sh -c to ensure the model pulls before the container starts serving
ENTRYPOINT ["sh", "-c", "ollama serve & sleep 10 && ollama pull qwen2.5-coder && ollama list && wait"]
|