From 630149d141f0b11f008e28e7a68e43bce665cae0 Mon Sep 17 00:00:00 2001 From: infosave2007 Date: Wed, 1 Jul 2026 13:40:24 +0300 Subject: [PATCH] docs: add docker-compose quickstart (gateway + Ollama) and GHCR badge - docker-compose.yml + config/gateway.compose.toml (routes to a local Ollama service) - README (EN+RU): ghcr badge + Docker Compose section --- CHANGELOG.md | 6 ++++++ README.md | 12 ++++++++++++ README.ru.md | 13 +++++++++++++ config/gateway.compose.toml | 27 +++++++++++++++++++++++++++ docker-compose.yml | 33 +++++++++++++++++++++++++++++++++ 5 files changed, 91 insertions(+) create mode 100644 config/gateway.compose.toml create mode 100644 docker-compose.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 5563c22..00c870a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to this project are documented here. The format is based on [Keep a Changelog](https://keepachangelog.com/). +## [Unreleased] + +### Added +- **Docker Compose** quickstart (`docker-compose.yml` + `config/gateway.compose.toml`): + gateway + a local Ollama model in one command. GHCR badge in the READMEs. + ## [0.2.2] - 2026-07-01 ### Added diff --git a/README.md b/README.md index 6afac0c..475439d 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ **English** · [Русский](https://github.com/infosave2007/cortiq-gateway/blob/master/README.ru.md) [![Crates.io](https://img.shields.io/crates/v/cortiq-gateway.svg)](https://crates.io/crates/cortiq-gateway) +[![Docker](https://img.shields.io/badge/ghcr.io-cortiq--gateway-2496ED?logo=docker&logoColor=white)](https://github.com/infosave2007/cortiq-gateway/pkgs/container/cortiq-gateway) [![CI](https://github.com/infosave2007/cortiq-gateway/actions/workflows/ci.yml/badge.svg)](https://github.com/infosave2007/cortiq-gateway/actions/workflows/ci.yml) [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://github.com/infosave2007/cortiq-gateway/blob/master/LICENSE) ![Rust](https://img.shields.io/badge/Rust-2021-orange.svg) @@ -68,6 +69,17 @@ cargo build --release # ./target/release/cortiq-gateway The image ships a default config and runs out of the box; mount `/app/config` (with a `gateway.toml`) to use your own. Tags: `:latest`, `:X.Y.Z`, `:edge` (linux/amd64 + arm64). +**Docker Compose** — gateway + a local Ollama model in one command: + +```bash +docker compose up -d +docker compose exec ollama ollama pull qwen2.5:0.5b # pull a model once +# → OpenAI API at http://localhost:9000/v1 · admin at /admin (token: change-me) +``` + +See [`docker-compose.yml`](docker-compose.yml). For smart routing, set `CORTIQ_ROUTER_KEY` +and add a `[router]` (see [docs/ROUTER.md](docs/ROUTER.md)). + --- ## 🖥️ Admin console diff --git a/README.ru.md b/README.ru.md index b546564..3fbcd2a 100644 --- a/README.ru.md +++ b/README.ru.md @@ -2,6 +2,8 @@ [English](README.md) · **Русский** +[![Crates.io](https://img.shields.io/crates/v/cortiq-gateway.svg)](https://crates.io/crates/cortiq-gateway) +[![Docker](https://img.shields.io/badge/ghcr.io-cortiq--gateway-2496ED?logo=docker&logoColor=white)](https://github.com/infosave2007/cortiq-gateway/pkgs/container/cortiq-gateway) [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE) ![Rust](https://img.shields.io/badge/Rust-2021-orange.svg) ![Status](https://img.shields.io/badge/status-active-success.svg) @@ -66,6 +68,17 @@ cargo build --release # ./target/release/cortiq-gateway (с `gateway.toml`), чтобы использовать свой. Теги: `:latest`, `:X.Y.Z`, `:edge` (linux/amd64 + arm64). +**Docker Compose** — шлюз + локальная модель Ollama одной командой: + +```bash +docker compose up -d +docker compose exec ollama ollama pull qwen2.5:0.5b # один раз скачать модель +# → OpenAI API на http://localhost:9000/v1 · панель на /admin (токен: change-me) +``` + +См. [`docker-compose.yml`](docker-compose.yml). Для умного роутинга задайте +`CORTIQ_ROUTER_KEY` и добавьте `[router]` (см. [docs/ROUTER.ru.md](docs/ROUTER.ru.md)). + --- ## 🖥️ Панель управления diff --git a/config/gateway.compose.toml b/config/gateway.compose.toml new file mode 100644 index 0000000..94dc05a --- /dev/null +++ b/config/gateway.compose.toml @@ -0,0 +1,27 @@ +# Config used by docker-compose.yml — routes to the Ollama service in the same +# compose network. Send model="local" (pinned) or "cortiq-auto" (falls back to the +# default model when no router is configured). Add a [router] key to enable smart routing. +listen = "0.0.0.0:9000" + +[router] +url = "http://localhost:8080" # optional; pinned/default works without a router +timeout_ms = 800 + +[[models]] +id = "local" +provider = "openai" +base_url = "http://ollama:11434/v1" # the Ollama service (see docker-compose.yml) +model = "qwen2.5:0.5b" +cost_tier = "cheap" + +[routing] +default = "local" + +[protocols] +openai_chat = true + +[admin] +enabled = true + +[telemetry] +metrics = true diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..82e60ae --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,33 @@ +# Quick start: Cortiq Gateway + a local model (Ollama). +# +# docker compose up -d +# docker compose exec ollama ollama pull qwen2.5:0.5b # pull the model once +# # → OpenAI-compatible API at http://localhost:9000/v1 +# # → admin console at http://localhost:9000/admin (token: change-me) +# +# For smart routing, add a [router] key to config/gateway.compose.toml +# (or set CORTIQ_ROUTER_KEY and point [router] at allaigate — see docs/ROUTER.md). +services: + gateway: + image: ghcr.io/infosave2007/cortiq-gateway:latest + ports: + - "9000:9000" + environment: + CORTIQ_ADMIN_TOKEN: change-me + CORTIQ_ROUTER_KEY: ${CORTIQ_ROUTER_KEY:-} + volumes: + - ./config/gateway.compose.toml:/app/config/gateway.toml:ro + depends_on: + - ollama + restart: unless-stopped + + ollama: + image: ollama/ollama + ports: + - "11434:11434" + volumes: + - ollama:/root/.ollama + restart: unless-stopped + +volumes: + ollama: