From 20b5417e307ba8255d7fa56004e0ba9a38997db1 Mon Sep 17 00:00:00 2001 From: Nick Yeoman Date: Wed, 10 Jun 2026 07:19:56 +0000 Subject: [PATCH] added opencode --- opencode/README.md | 21 +++++++++++++++++++++ opencode/compose.yaml | 21 +++++++++++++++++++++ opencode/config/config.json | 17 +++++++++++++++++ opencode/sample.env | 5 +++++ 4 files changed, 64 insertions(+) create mode 100644 opencode/README.md create mode 100644 opencode/compose.yaml create mode 100644 opencode/config/config.json create mode 100644 opencode/sample.env diff --git a/opencode/README.md b/opencode/README.md new file mode 100644 index 0000000..175e68d --- /dev/null +++ b/opencode/README.md @@ -0,0 +1,21 @@ +# OpenCode + +## Overview + +I have added a config file that uses local ollama (see ollama directory of cookbooks) + +## Project Details + +- **Project Repository:** [Link](https://example.com) +- **Container Image:** [Docker Hub](https://dockerhub.com) +- **Compose Example:** [Compose](https://dockerhub.com) +- **Documentation:** [Docs](https://dockerhub.com) +- **Reverse Proxy Port:** `80` + +## Config file + +You can copy the config.json file to your volume. Change the model and host data to your settings. + +## Gotcha + +Config ollama: https://github.com/p-lemonish/ollama-x-opencode diff --git a/opencode/compose.yaml b/opencode/compose.yaml new file mode 100644 index 0000000..55f9f54 --- /dev/null +++ b/opencode/compose.yaml @@ -0,0 +1,21 @@ +# OpenCode Docker Compose + +services: + opencode: + image: ${OPENCODE_IMAGE_NAME:-ghcr.io/anomalyco/opencode:latest} + restart: ${OPENCODE_RESTART:-unless-stopped} + + volumes: + - ${VOL_PATH:-/data}/opencode/config:/config + - ${VOL_PATH:-/data}/opencode/data:/data + - ${VOL_PATH:-/data}/opencode/projects:/projects + + environment: + - OPENCODE_PORT=${OPENCODE_PORT:-4096} + - OPENCODE_HOSTNAME=${OPENCODE_HOSTNAME:-localhost} + - OPENCODE_CONFIG=/config/config.json + - OPENCODE_MODEL=ollama/qwen3:8b-16k + - OLLAMA_HOST=http://10.1.1.16:11434 + + ports: + - "${OPENCODE_PORT:-4096}:4096" diff --git a/opencode/config/config.json b/opencode/config/config.json new file mode 100644 index 0000000..08b9a57 --- /dev/null +++ b/opencode/config/config.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://opencode.ai/config.json", + "model": "ollama/qwen3:8b-16k", + "provider": { + "ollama": { + "npm": "@ai-sdk/openai-compatible", + "options": { + "baseURL": "http://10.1.1.16:11434/v1" + }, + "models": { + "qwen3:8b-16k": { + "tools": true + } + } + } + } +} \ No newline at end of file diff --git a/opencode/sample.env b/opencode/sample.env new file mode 100644 index 0000000..b6ebd59 --- /dev/null +++ b/opencode/sample.env @@ -0,0 +1,5 @@ +OPENCODE_IMAGE_NAME=ghcr.io/anomalyco/opencode:latest +OPENCODE_RESTART=unless-stopped +VOL_PATH=/home/youruser/.local/share +OPENCODE_PORT=4096 +OPENCODE_HOSTNAME=localhost