FROM ollama/ollama:latest # Install OpenSSH server and set root password to 'admin' . RUN apt-get update && \ apt-get install -y openssh-server && \ mkdir /var/run/sshd && \ echo 'root:admin' | chpasswd && \ sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \ sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config # Configure Ollama for Hugging Face routing ENV OLLAMA_HOST=0.0.0.0:7860 ENV OLLAMA_ORIGINS="*" # Bake the model into the image to avoid pulling on every restart RUN nohup bash -c "ollama serve &" && \ sleep 5 && \ ollama run gemma4:31b-cloud && \ pkill ollama # Copy and format the startup script COPY start.sh /start.sh RUN chmod +x /start.sh # Expose ports for HF Ingress and SSH EXPOSE 7860 22 # Launch the wrapper script ENTRYPOINT ["/start.sh"]