auto-update-daily-20260202
 1# Use a lightweight Python base image
 2FROM python:3.11-slim
 3
 4# Set working directory
 5WORKDIR /app
 6
 7# Copy required files
 8COPY ollama_exporter.py .
 9
10# Install dependencies
11RUN pip install fastapi uvicorn prometheus_client httpx
12
13# Expose the metrics port
14EXPOSE 8000
15
16# Define runtime environment variable for Ollama host (can be overridden)
17ENV OLLAMA_HOST="http://localhost:11434"
18
19# Start the FastAPI app
20CMD ["uvicorn", "ollama_exporter:app", "--host", "0.0.0.0", "--port", "8000"]