| # 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"] | |