Spaces:
Sleeping
Sleeping
| FROM ollama/ollama:latest | |
| # Use /tmp for Ollama data (writable by all users) | |
| ENV OLLAMA_HOME=/tmp/ollama | |
| RUN mkdir -p /tmp/ollama && chmod 777 /tmp/ollama | |
| # Install netcat-openbsd (more reliable than netcat) | |
| RUN apt-get update && apt-get install -y netcat-openbsd && rm -rf /var/lib/apt/lists/* | |
| # Copy the entrypoint script | |
| COPY entrypoint.sh /usr/local/bin/entrypoint.sh | |
| # Set permissions for the entrypoint script | |
| RUN chmod +x /usr/local/bin/entrypoint.sh | |
| # Set Ollama to listen on all network interfaces | |
| ENV OLLAMA_HOST=0.0.0.0:7860 | |
| # Expose the default port | |
| EXPOSE 7860 | |
| # Use the custom entrypoint script | |
| ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] |