File size: 750 Bytes
18de007
 
 
 
 
 
e4181a0
18de007
 
 
 
f894630
18de007
 
 
 
 
e4181a0
 
 
 
 
 
 
 
 
 
 
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
# Use an official Python base image
FROM python:3.8-slim

# Set the working directory inside the container
WORKDIR /app

# Install system dependencies, curl, and other necessary utilities
RUN apt-get update && apt-get install -y \
    curl \
    && pip install --upgrade pip

# Install Ollama
RUN curl -sSL https://ollama.com/install.sh | bash

# Expose the port for the model server (assuming default port 5000)
EXPOSE 5000

# Start the Ollama service, pull the model, and then serve it
CMD /bin/bash -c "
  # Start Ollama service in the background
  nohup ollama & \
  # Wait for Ollama to be ready
  sleep 10 && \
  # Pull the llama-3.2 model
  ollama pull llama-3.2 && \
  # Start serving the model
  ollama serve --model llama-3.2 --port 5000
"