Spaces:
Configuration error
Configuration error
# 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 | |
" | |