-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (33 loc) · 1.48 KB
/
Copy pathDockerfile
File metadata and controls
40 lines (33 loc) · 1.48 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
32
33
34
35
36
37
38
39
40
# autotune + Ollama — single container
#
# Build: docker build -t autotune .
# Run: docker run -p 8765:8765 -v ollama_models:/root/.ollama autotune
#
# The image bundles Ollama (the LLM runtime) and autotune (the OpenAI-compatible
# optimisation middleware). The entrypoint starts Ollama in the background,
# waits until it is ready, then starts autotune serve on port 8765.
#
# Environment variables
# ---------------------
# OLLAMA_MODEL Pull this model on first start (e.g. "llama3.2:3b")
# AUTOTUNE_PORT autotune listen port (default 8765)
# OLLAMA_HOST Ollama bind address passed to ollama serve (default 0.0.0.0)
# AUTOTUNE_OLLAMA_URL URL autotune uses to reach Ollama (default http://localhost:11434)
# Set to http://ollama:11434 when using docker-compose multi-container mode
FROM ollama/ollama:latest
# Install Python 3 and pip
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python3 \
python3-pip \
curl \
&& rm -rf /var/lib/apt/lists/*
RUN pip3 install --no-cache-dir --break-system-packages llm-autotune
# Expose autotune's API port (Ollama's 11434 is already exposed by the base image)
EXPOSE 8765
# Persist downloaded models across container restarts
VOLUME ["/root/.ollama"]
# Copy and set the entrypoint
COPY docker-entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]