# Builder stage FROM ubuntu:latest RUN apt update && apt install curl -y RUN curl -fsSL https://ollama.com/install.sh | sh ENV OLLAMA_HOST=0.0.0.0 RUN useradd -m appuser && chown -R appuser:appuser /home/appuser # Create the directory and give appropriate permissions RUN mkdir -p /home/appuser/.ollama && chmod 777 /home/appuser/.ollama #RUN mkdir -p /home/appuser/.ollama/models && USER appuser WORKDIR /home/appuser/.ollama #Copy dossier de models #COPY --chown=appuser models /.ollama #RUN chmod 777 /home/appuser/.ollama/models # Copy the entry point script COPY --chown=appuser entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh # Set the entry point script as the default command ENTRYPOINT ["/entrypoint.sh"] #CMD ollama serve # Set the model as an environment variable (this can be overridden) ENV model="gemma:7b-instruct" #ENV OLLAMA_MODELS="/home/appuser/.ollama/models" # Expose the server port EXPOSE 7860