FROM python:3.10-slim-buster | |
WORKDIR /app | |
# Copy the script into the container's /app directory | |
COPY ollama.sh /app/ollama.sh | |
# Create virtual environment and set permissions | |
RUN python -m venv venv && \ | |
chmod +x /app/ollama.sh | |
# Install Ollama | |
RUN curl https://ollama.ai/install.sh | sh | |
# Prepare Ollama directory | |
RUN mkdir -p /.ollama && chmod 777 /.ollama | |
# Ensure Ollama binary is accessible | |
ENV PATH="/root/.ollama/bin:$PATH" | |
EXPOSE 11434 | |
# Use the correct path to the script | |
ENTRYPOINT ["/app/ollama.sh"] |