File size: 880 Bytes
2b9126c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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"]