Skip to content

Commit 618c582

Browse files
authored
docs: update README with Docker usage instructions and environment variables (#64)
* docs: update README with Docker usage instructions and environment variables * docs: enhance README with new Docker usage instructions and multi-arch image details * docs: fix PyPI badge label in README * chore: remove mock-weather-mcp-server from .dockerignore * feat: add labels to Dockerfile and workflow for better image metadata
1 parent 460acb9 commit 618c582

File tree

4 files changed

+49
-8
lines changed

4 files changed

+49
-8
lines changed

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ tests/
2020

2121
# Dev / example servers
2222
misc/
23-
mock-weather-mcp-server/
2423

2524
# Python artifacts
2625
__pycache__/

.github/workflows/build_and_push_docker_image.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ jobs:
7777
platforms: linux/amd64,linux/arm64
7878
push: true
7979
tags: ${{ steps.meta.outputs.tags }}
80+
labels: ${{ steps.meta.outputs.labels }}
8081
build-args: |
8182
VERSION=${{ github.event.release.tag_name || inputs.tag_name }}
8283

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ RUN pip install uv
88
ARG VERSION=0.1.0
99
ENV SETUPTOOLS_SCM_PRETEND_VERSION=${VERSION}
1010

11+
LABEL org.opencontainers.image.source="https://github.com/jonigl/ollama-mcp-bridge"
12+
LABEL org.opencontainers.image.description="Bridge API service connecting Ollama with Model Context Protocol (MCP) servers"
13+
LABEL org.opencontainers.image.licenses="MIT"
14+
LABEL org.opencontainers.image.version="${VERSION}"
15+
1116
COPY . ./
1217

1318
RUN uv sync

README.md

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
# Ollama MCP Bridge
1010

11-
[![PyPI - Python Version](https://img.shields.io/pypi/v/ollama-mcp-bridge?label=ollama-mcp-bridge-pypi)](https://pypi.org/project/ollama-mcp-bridge/)
11+
[![PyPI - Package Version](https://img.shields.io/pypi/v/ollama-mcp-bridge?label=ollama-mcp-bridge)](https://pypi.org/project/ollama-mcp-bridge/)
1212
[![CI](https://github.com/jonigl/ollama-mcp-bridge/actions/workflows/ci.yml/badge.svg)](https://github.com/jonigl/ollama-mcp-bridge/actions/workflows/ci.yml)
1313
[![Test Publish](https://github.com/jonigl/ollama-mcp-bridge/actions/workflows/test-publish.yml/badge.svg)](https://github.com/jonigl/ollama-mcp-bridge/actions/workflows/test-publish.yml)
1414
[![Publish](https://github.com/jonigl/ollama-mcp-bridge/actions/workflows/publish.yml/badge.svg)](https://github.com/jonigl/ollama-mcp-bridge/actions/workflows/publish.yml)
@@ -23,13 +23,13 @@
2323
- [Quick Start](#quick-start)
2424
- [Or, install from PyPI with pip](#or-install-from-pypi-with-pip)
2525
- [Or, run with Docker Compose](#or-run-with-docker-compose)
26-
- [Or, run with Docker only](#or-run-with-docker-only)
26+
- **✨NEW** [Or, run with Docker only](#or-run-with-docker-only)
2727
- [Or, install from source](#or-install-from-source)
2828
- [How It Works](#how-it-works)
2929
- [Configuration](#configuration)
3030
- [MCP Servers Configuration](#mcp-servers-configuration)
31-
- **✨NEW** [Tool Filtering](#tool-filtering)
32-
- [Variable Expansion](#variable-expansion)
31+
- [Tool Filtering](#tool-filtering)
32+
- [Variable Expansion](#variable-expansion)
3333
- [CORS Configuration](#cors-configuration)
3434
- [Environment Variables](#environment-variables)
3535
- [Usage](#usage)
@@ -67,6 +67,7 @@
6767
- 📊 **Structured Logging**: Uses loguru for comprehensive logging
6868
- 📦 **PyPI Package**: Easily installable via pip or uv from PyPI
6969
- 🗣️ **System Prompt Configuration**: Allows setting a system prompt for the assistant's behavior
70+
- 🐳 **Multi-Arch Docker Images****NEW**: Pre-built `linux/amd64` and `linux/arm64` images published to GitHub Container Registry on every release
7071

7172
## Requirements
7273

@@ -92,16 +93,51 @@ pip install --upgrade ollama-mcp-bridge
9293
### Or, run with Docker Compose
9394

9495
```bash
95-
docker-compose up
96+
docker compose up
9697
```
9798

9899
This uses the included [docker-compose.yml](./docker-compose.yml) file which:
99-
- Builds the bridge from source using this Dockerfile [Dockerfile](./Dockerfile)
100+
- Builds the bridge from source using the [Dockerfile](./Dockerfile)
100101
- Connects to Ollama running on the host machine (`host.docker.internal:11434`)
101102
- Maps the configuration file from [./mcp-config.json](./mcp-config.json) (includes mock [weather server for demo](./mock-weather-mcp-server))
103+
- Exposes port `8000` on the host
102104
- Allows all CORS origins (configurable via `CORS_ORIGINS` environment variable)
103105
- Supports configurable Ollama request timeouts via `OLLAMA_PROXY_TIMEOUT`
104106

107+
> [!TIP]
108+
> To skip the local build and use the pre-built image from GitHub Container Registry instead, replace the `build:` block in `docker-compose.yml` with:
109+
> ```yaml
110+
> image: ghcr.io/jonigl/ollama-mcp-bridge:latest
111+
> ```
112+
113+
### Or, run with Docker only
114+
115+
> [!NOTE]
116+
> ✨ **NEW**: Pre-built multi-arch Docker images (`linux/amd64` and `linux/arm64`) are now published automatically to the GitHub Container Registry on every release. No local build required!
117+
118+
Pre-built multi-arch images (`linux/amd64` and `linux/arm64`) are published to the [GitHub Container Registry](https://github.com/jonigl/ollama-mcp-bridge/pkgs/container/ollama-mcp-bridge) on every release. Available tags:
119+
- `latest` — most recent stable release
120+
- `vX.Y.Z` — specific version (e.g. `v0.10.0`)
121+
- `sha-<commit>` — exact commit SHA build
122+
123+
```bash
124+
docker run -p 8000:8000 \
125+
-e OLLAMA_URL=http://host.docker.internal:11434 \
126+
-v "$PWD/mcp-config.json:/mcp-config.json" \
127+
-v "$PWD/mock-weather-mcp-server:/mock-weather-mcp-server" \
128+
-w / \
129+
ghcr.io/jonigl/ollama-mcp-bridge:latest
130+
```
131+
132+
Key flags:
133+
- `-p 8000:8000` — exposes the bridge on your host at port `8000`
134+
- `-e OLLAMA_URL=http://host.docker.internal:11434` — routes Ollama traffic to the host machine (required on macOS and Windows; on Linux use `--network host` or the host's IP instead)
135+
- `-v "$PWD/mcp-config.json:/mcp-config.json"` — mounts your local config into the container
136+
- `-v "$PWD/mock-weather-mcp-server:/mock-weather-mcp-server"` — mounts the mock MCP server **without** `:ro` so `uv` can create its `.venv` inside the directory
137+
- `-w /` — sets the working directory to `/` so relative paths in `mcp-config.json` resolve correctly
138+
139+
> [!NOTE]
140+
> On Linux, `host.docker.internal` may not resolve automatically. Use `--network host` and keep `OLLAMA_URL=http://localhost:11434`, or replace it with your host's LAN IP.
105141
106142
### Or, install from source
107143
@@ -313,7 +349,7 @@ CORS_ORIGINS="http://localhost:3000,http://localhost:8080,https://app.example.co
313349
> Using `CORS_ORIGINS="*"` allows all origins and is not recommended for production. Always specify exact origins for security.
314350
315351
316-
### Environment Variables:
352+
### Environment Variables
317353
- `CORS_ORIGINS`: Comma-separated list of allowed origins (default: `*`)
318354
- `*` allows all origins (shows warning in logs)
319355
- Example: `CORS_ORIGINS="http://localhost:3000,https://myapp.com" ollama-mcp-bridge`

0 commit comments

Comments
 (0)