FROM python:3.10-slim-buster | |
WORKDIR /app | |
# Copy script with proper permissions | |
COPY ollama.sh /app/ollama.sh | |
RUN chmod +x /app/ollama.sh | |
# Install system dependencies and Ollama | |
RUN apt-get update && apt-get install -y curl && \ | |
curl https://ollama.ai/install.sh | sh | |
# Create directory with correct permissions | |
RUN mkdir -p /.ollama && chmod 777 /.ollama | |
# Ensure Ollama is in PATH (standard installation location) | |
ENV PATH="/usr/local/bin:$PATH" | |
EXPOSE 11434 | |
# Use absolute path to script | |
ENTRYPOINT ["/app/ollama.sh"] |