-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile.autotune
More file actions
31 lines (24 loc) · 1.16 KB
/
Copy pathDockerfile.autotune
File metadata and controls
31 lines (24 loc) · 1.16 KB
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
30
31
# autotune-only image — for docker-compose multi-container setup where Ollama
# runs as a separate service. Much smaller than the bundled image (~200 MB
# vs ~2 GB) because it contains only Python and autotune, not the Ollama binary.
#
# Set AUTOTUNE_OLLAMA_URL=http://ollama:11434 in the environment so autotune
# knows where to reach the separate Ollama container.
#
# Build: docker build -f Dockerfile.autotune -t autotune-server .
# Run: docker run -e AUTOTUNE_OLLAMA_URL=http://ollama:11434 -p 8765:8765 autotune-server
FROM python:3.11-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl \
&& rm -rf /var/lib/apt/lists/*
# AUTOTUNE_VERSION is passed by CI (e.g. "1.2.0"). Omit to install latest.
ARG AUTOTUNE_VERSION
RUN pip install --no-cache-dir \
"llm-autotune${AUTOTUNE_VERSION:+==$AUTOTUNE_VERSION}"
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD curl -sf http://localhost:${AUTOTUNE_PORT}/health || exit 1
EXPOSE 8765
ENV AUTOTUNE_PORT=8765 \
AUTOTUNE_OLLAMA_URL=http://localhost:11434 \
AUTOTUNE_LOG_PROMPTS=0
CMD ["sh", "-c", "autotune serve --host 0.0.0.0 --port ${AUTOTUNE_PORT}"]