Skip to content

Personal AI, On Personal Devices

Python

feat: NVIDIA GPU Docker support with compose override (#93)

mattiasghodsian16f601c7d7a1
diff --git a/README.md b/README.md
index 39f3f0a5..0b885e24 100644
--- a/README.md
+++ b/README.md
@@ -68,6 +68,28 @@ uv run jarvis doctor
`jarvis init` auto-detects your hardware and recommends the best engine. After init, it prints engine-specific next steps. Run `uv run jarvis doctor` at any time to diagnose configuration or connectivity issues.
+## Docker
+
+A Docker Compose configuration bundles Jarvis with Ollama:
+
+```bash
+# CPU-only (default)
+docker compose -f deploy/docker/docker-compose.yml up -d
+
+# NVIDIA GPU (requires NVIDIA Container Toolkit)
+docker compose -f deploy/docker/docker-compose.yml \
+ -f deploy/docker/docker-compose.gpu.nvidia.yml up -d
+
+# AMD GPU (requires ROCm)
+docker compose -f deploy/docker/docker-compose.yml \
+ -f deploy/docker/docker-compose.gpu.rocm.yml up -d
+
+# Pull a model into Ollama
+docker compose -f deploy/docker/docker-compose.yml exec ollama ollama pull qwen3:8b
+```
+
+Services: Jarvis on `:8000`, Ollama on `:11434`.
+
## Development
From source, you need to make sure Rust is installed on System:
diff --git a/deploy/docker/Dockerfile b/deploy/docker/Dockerfile
index 4f5b8291..6e1f1e50 100644
--- a/deploy/docker/Dockerfile
+++ b/deploy/docker/Dockerfile
@@ -8,7 +8,7 @@ COPY frontend/ .
RUN npm run build
# Stage 2: Build Python package
-FROM python:3.12-slim AS builder
+FROM python:3.12-slim-bookworm AS builder
WORKDIR /app
COPY pyproject.toml README.md ./
@@ -21,7 +21,7 @@ RUN pip install --no-cache-dir uv && \
uv pip install --system ".[server]"
# Stage 3: Runtime
-FROM python:3.12-slim
+FROM python:3.12-slim-bookworm
COPY --from=builder /usr/local /usr/local
COPY --from=builder /app /app
diff --git a/deploy/docker/docker-compose.gpu.nvidia.yml b/deploy/docker/docker-compose.gpu.nvidia.yml
new file mode 100644
index 00000000..22dcb450
--- /dev/null
+++ b/deploy/docker/docker-compose.gpu.nvidia.yml
@@ -0,0 +1,31 @@
+# NVIDIA GPU override — use with:
+# docker compose -f deploy/docker/docker-compose.yml -f deploy/docker/docker-compose.gpu.nvidia.yml up
+
+services:
+ jarvis:
+ build:
+ context: ../..
+ dockerfile: deploy/docker/Dockerfile.gpu
+ volumes:
+ - /proc:/proc:ro
+ - /sys:/sys:ro
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: all
+ capabilities: [gpu]
+
+ ollama:
+ image: ollama/ollama:latest
+ environment:
+ - NVIDIA_VISIBLE_DEVICES=all
+ - NVIDIA_DRIVER_CAPABILITIES=compute,utility
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: all
+ capabilities: [gpu]
diff --git a/deploy/docker/docker-compose.yml b/deploy/docker/docker-compose.yml
index a19268ef..284f0897 100644
--- a/deploy/docker/docker-compose.yml
+++ b/deploy/docker/docker-compose.yml
@@ -1,5 +1,3 @@
-version: "3.9"
-
services:
jarvis:
build:
@@ -9,17 +7,24 @@ services:
- "8000:8000"
environment:
- OPENJARVIS_ENGINE_DEFAULT=ollama
- - OPENJARVIS_OLLAMA_HOST=http://ollama:11434
+ - OLLAMA_HOST=http://ollama:11434
depends_on:
- - ollama
+ ollama:
+ condition: service_healthy
restart: unless-stopped
ollama:
- image: ollama/ollama
+ image: ollama/ollama:latest
ports:
- "11434:11434"
volumes:
- ollama-models:/root/.ollama
+ healthcheck:
+ test: ["CMD", "ollama", "list"]
+ interval: 5s
+ timeout: 3s
+ retries: 10
+ start_period: 10s
restart: unless-stopped
volumes: