# 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 cut -d: -f1,3 /etc/passwd RUN useradd -m -u 1001 appuser && chown -R appuser:appuser /home/appuser USER appuser # Create the directory and give appropriate permissions #RUN mkdir -p /.ollama && chmod 777 /.ollama #RUN mkdir -p /home/appuser/.ollama && chmod 777 /home/appuser/.ollama #RUN mkdir -p /home/appuser/.ollama/models && # # #Copy fichiers blobs #RUN mkdir /usr/share/ollama/.ollama/models && chmod 777 /usr/share/ollama/.ollama/models #RUN mkdir /usr/share/ollama/.ollama/models/blobs && chmod 777 /usr/share/ollama/.ollama/models/blobs #COPY --chown=appuser alfred_erbot/blobs /usr/share/ollama/.ollama/models/blobs #COPY --chown=appuser command_erbot/blobs /usr/share/ollama/.ollama/models/blobs #COPY --chown=appuser dolphi-phi_erbot/blobs /usr/share/ollama/.ollama/models/blobs #COPY --chown=appuser falcon_erbot/blobs /usr/share/ollama/.ollama/models/blobs #COPY --chown=appuser gemma_erbot/blobs /usr/share/ollama/.ollama/models/blobs #COPY --chown=appuser llama2_erbot/blobs /usr/share/ollama/.ollama/models/blobs #COPY --chown=appuser meditron_erbot/blobs /usr/share/ollama/.ollama/models/blobs #COPY --chown=appuser medllama_erbot/blobs /usr/share/ollama/.ollama/models/blobs #COPY --chown=appuser mistral_erbot/blobs /usr/share/ollama/.ollama/models/blobs #COPY --chown=appuser mistrallite_erbot/blobs /usr/share/ollama/.ollama/models/blobs #COPY --chown=appuser openchat_erbot/blobs /usr/share/ollama/.ollama/models/blobs #COPY --chown=appuser stablelm2_erbot/blobs /usr/share/ollama/.ollama/models/blobs COPY mxbai-embed-large/blobs /usr/share/ollama/.ollama/models/blobs #COPY --chown=appuser openchat_story/blobs /usr/share/ollama/.ollama/models/blobs #COPY --chown=appuser mistral_story/blobs /usr/share/ollama/.ollama/models/blobs #COPY --chown=appuser mistrallite_story/blobs /usr/share/ollama/.ollama/models/blobs COPY all-minilm/blobs /usr/share/ollama/.ollama/models/blobs COPY nomic-embed-text/blobs /usr/share/ollama/.ollama/models/blobs COPY llama3/blobs /usr/ollama/.ollama/models/blobs #Création des dossier pour recevoir les fichiers latest RUN mkdir /usr/share/ollama/.ollama/models/manifests && chmod 777 /usr/share/ollama/.ollama/models/manifests RUN mkdir /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai && chmod 777 /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai RUN mkdir /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library && chmod 777 /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library RUN mkdir /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/llama3 && chmod 777 /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/llama3 #RUN mkdir /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/command_erbot && chmod 777 /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/command_erbot #RUN mkdir /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/dolphi-phi_erbot && chmod 777 /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/dolphi-phi_erbot #RUN mkdir /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/falcon_erbot && chmod 777 /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/falcon_erbot #RUN mkdir /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/gemma_erbot && chmod 777 /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/gemma_erbot #RUN mkdir /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/llama2_erbot && chmod 777 /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/llama2_erbot #RUN mkdir /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/meditron_erbot && chmod 777 /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/meditron_erbot #RUN mkdir /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/medllama_erbot && chmod 777 /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/medllama_erbot #RUN mkdir /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/mistral_erbot && chmod 777 /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/mistral_erbot #RUN mkdir /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/mistrallite_erbot && chmod 777 /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/mistrallite_erbot #RUN mkdir /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/openchat_erbot && chmod 777 /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/openchat_erbot #RUN mkdir /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/stablelm2_erbot && chmod 777 /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/stablelm2_erbot RUN mkdir /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/mxbai-embed-large && chmod 777 /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/mxbai-embed-large #RUN mkdir /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/openchat_story && chmod 777 /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/openchat_story #RUN mkdir /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/mistral_story && chmod 777 /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/mistral_story #RUN mkdir /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/mistrallite_story && chmod 777 /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/mistrallite_story RUN mkdir /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/all-minilm && chmod 777 /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/all-minilm RUN mkdir /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/nomic-embed-text && chmod 777 /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/nomic-embed-text #Copy des fichiers latest COPY llama3/latest /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/llama3 #COPY --chown=appuser alfred_erbot/latest /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/alfred_erbot #COPY --chown=appuser command_erbot/latest /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/command_erbot #COPY --chown=appuser dolphi-phi_erbot/latest /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/dolphi-phi_erbot #COPY --chown=appuser falcon_erbot/latest /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/falcon_erbot #COPY --chown=appuser gemma_erbot/latest /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/gemma_erbotCOPY --chown=appuser llama2_erbot/latest /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/llama2_erbot #COPY --chown=appuser meditron_erbot/latest /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/meditron_erbot #COPY --chown=appuser medllama_erbot/latest /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/medllama_erbot #COPY --chown=appuser mistral_erbot/latest /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/mistral_erbot #COPY --chown=appuser mistrallite_erbot/latest /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/mistrallite_erbot #COPY --chown=appuser openchat_erbot/latest /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/openchat_erbot #COPY --chown=appuser stablelm2_erbot/latest /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/stablelm2_erbot COPY mxbai-embed-large/latest /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/mxbai-embed-large #COPY --chown=appuser openchat_story/latest /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/openchat_story #COPY --chown=appuser mistral_story/latest /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/mistral_story COPY mistrallite_story/latest /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/mistrallite_story COPY all-minilm/latest /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/all-minilm COPY nomic-embed-text/latest /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/nomic-embed-text #COPY --chown=appuser mixtral_erbot/latest /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/mistral_erbot #COPY --chown=appuser models /usr/share/ollama/.ollama/models #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="nomic-embed-text","yayarun/mixtral_erbot" ENV OLLAMA_MODELS="/usr/share/ollama/.ollama/models" # Expose the server port EXPOSE 7860