FROM python:3.10-slim-buster | |
WORKDIR /app | |
COPY ollama.sh /app | |
RUN python -m venv venv && \ | |
. /app/venv/bin/activate | |
RUN chmod +x ollama.sh | |
# Install Ollama | |
RUN curl https://ollama.ai/install.sh | sh | |
# Create the directory and give appropriate permissions | |
RUN mkdir -p /.ollama && chmod 777 /.ollama | |
# Ensure Ollama binary is in the PATH | |
ENV PATH="/app/venv/bin:/root/.ollama/bin:$PATH" | |
EXPOSE 11434 | |
ENTRYPOINT ["/ollama.sh"] |