Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions blueprints/opencode/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
version: "3.8"

services:
opencode:
image: ghcr.io/anomalyco/opencode:1.18.32
restart: unless-stopped
entrypoint: []
# The official image is minimal (no git/node). Provision a toolchain on
# start-up so the agent can clone repos and run project commands.
# Set TOOLCHAIN_PACKAGES to "" to skip it, or to e.g. "git go" for another stack.
command:
- sh
- -c
- |
set -e
apk add --no-cache $${TOOLCHAIN_PACKAGES} >/dev/null 2>&1 || true
if [ -n "$${GIT_TOKEN}" ] && [ -n "$${GIT_REPO_URL}" ]; then
host=$$(printf '%s' "$${GIT_REPO_URL}" | sed -E 's#^https?://([^/]+)/.*#\1#')
git config --global credential.helper store
printf 'https://x-access-token:%s@%s\n' "$${GIT_TOKEN}" "$$host" > /root/.git-credentials
fi
if [ -n "$${GIT_REPO_URL}" ]; then
dir="/workspace/$$(basename "$${GIT_REPO_URL}" .git)"
[ -d "$$dir/.git" ] || git clone "$${GIT_REPO_URL}" "$$dir" || true
fi
exec opencode serve --hostname 0.0.0.0 --port 4096
working_dir: /workspace
expose:
- 4096
environment:
- OPENCODE_SERVER_USERNAME=${OPENCODE_SERVER_USERNAME}
- OPENCODE_SERVER_PASSWORD=${OPENCODE_SERVER_PASSWORD}
- TOOLCHAIN_PACKAGES=${TOOLCHAIN_PACKAGES}
- GIT_REPO_URL=${GIT_REPO_URL}
- GIT_TOKEN=${GIT_TOKEN}
volumes:
- opencode-data:/root/.local/share/opencode
- opencode-config:/root/.config/opencode
- opencode-workspace:/workspace

volumes:
opencode-data:
opencode-config:
opencode-workspace:
19 changes: 19 additions & 0 deletions blueprints/opencode/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"id": "opencode",
"name": "OpenCode",
"version": "1.18.32",
"description": "OpenCode is an open source AI coding agent. This template runs its password-protected web UI; optionally set a repository URL to clone on start-up, then chat with, edit and run your code from the browser.",
"logo": "opencode.svg",
"links": {
"github": "https://github.com/anomalyco/opencode",
"website": "https://opencode.ai",
"docs": "https://opencode.ai/v2/docs"
},
"tags": [
"ai",
"coding",
"agent",
"development",
"self-hosted"
]
}
7 changes: 7 additions & 0 deletions blueprints/opencode/opencode.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions blueprints/opencode/template.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[variables]
main_domain = "${domain}"
opencode_password = "${password:32}"

[config]
[[config.domains]]
serviceName = "opencode"
port = 4096
host = "${main_domain}"
https = true

[config.env]
OPENCODE_SERVER_USERNAME = "opencode"
OPENCODE_SERVER_PASSWORD = "${opencode_password}"
# Packages installed in the container at start-up (Alpine apk).
# Set to "" to keep the minimal image, or adapt to your stack (e.g. "git go").
TOOLCHAIN_PACKAGES = "git nodejs npm python3"
# Optional: clone a repository into /workspace on start-up.
# Leave GIT_REPO_URL empty to skip. Set GIT_TOKEN (GitHub PAT, Contents: read) for private repos.
GIT_REPO_URL = ""
GIT_TOKEN = ""
Loading