A Docker image providing a sandboxed environment for ai coding agents.
  • Shell 28.1%
  • Python 19.1%
  • CSS 16.1%
  • C# 13.5%
  • HTML 10.6%
  • Other 12.6%
Find a file
twerner 3c84752090
All checks were successful
Build / build (push) Successful in 4s
feat: add AI Code Review script and workflow for automated code reviews
2026-05-21 10:17:22 +02:00
.forgejo/workflows Fix issues from code review 2026-05-20 12:27:03 +00:00
docs Update documentation 2026-05-20 12:30:53 +00:00
template/dotnet-webapp-template feat: add AI Code Review script and workflow for automated code reviews 2026-05-21 10:17:22 +02:00
.env.example Fix issues from code review 2026-05-20 12:27:03 +00:00
.gitattributes Add .gitattributes file to manage line endings and text normalization 2026-05-18 22:09:27 +02:00
.gitignore feat: add DataStoring and DataStoring.Contract project files to dotnet webapp template 2026-05-21 08:36:51 +02:00
.repomixignore add repomix configuration 2026-05-20 11:59:22 +00:00
AGENTS.md Merge main into dev and resolve conflicts in AGENTS.md and entrypoint.sh 2026-05-20 13:13:43 +00:00
docker-compose.yml refactor: replace docker volumes with bind mounts for better backup and modification 2026-05-20 09:52:38 +00:00
Dockerfile Fix issues from code review 2026-05-20 12:27:03 +00:00
entrypoint.sh Merge main into dev and resolve conflicts in AGENTS.md and entrypoint.sh 2026-05-20 13:13:43 +00:00
forgejo-pr.sh Refactor Dockerfile and forgejo-pr.sh script: update file paths, enhance logging, and improve error handling 2026-05-19 07:46:05 +02:00
LICENSE Initial commit 2026-05-18 19:29:06 +00:00
opencode.json.template fix: update ollama-cloud provider config to fix unauthorized error 2026-05-20 11:23:18 +00:00
README.md docs: add opencode.json model configuration example to README 2026-05-20 14:18:28 +00:00
repomix.config.json add repomix configuration 2026-05-20 11:59:22 +00:00

coding-agent

A Docker image providing a sandboxed environment for opencode-ai.

Image structure

  • Base: ubuntu:24.04
  • Runtime tooling: Node.js/npm, .NET 10.0 SDK (/usr/local/dotnet), opencode-ai (npm global), Mistral Vibe CLI
  • Entrypoint: entrypoint.sh — configures git from env vars, then execs the CMD
  • Default workdir: /workspace

Usage

# Build
docker build -t coding-agent .

# Run interactively
docker run -it --rm \
  -e GIT_USER_NAME="Your Name" \
  -e GIT_USER_EMAIL="you@example.com" \
  coding-agent

docker-compose

docker compose up -d

Once running, the web UI (ttyd) is available at http://localhost:7681 — but only if TTYD_USERNAME and TTYD_PASSWORD are set in your .env file. Without these, the container starts the default CMD (bash).

See .env.example for environment variable configuration.

Included tools

ttyd — Web terminal

ttyd provides a browser-accessible terminal at port 7681. When TTYD_USERNAME and TTYD_PASSWORD are set, the entrypoint starts ttyd with HTTP Basic Auth, giving you a full shell in the browser — no docker exec needed.

forgejo-pr

A script available inside the container at /usr/local/bin/forgejo-pr that creates pull requests via the Forgejo REST API. Auto-detects owner/repo from the git remote origin.

forgejo-pr --title "My PR" --head feature --base main

See forgejo-pr --help for full options. Connection details default from GIT_HOST/GIT_TOKEN environment variables.

Mistral Vibe CLI

Mistral Vibe CLI is installed. Run vibe --setup to configure it.

Environment variables

Git

Variable Default Description
GIT_USER_NAME Git user name
GIT_USER_EMAIL Git user email
GIT_TOKEN Git credential token (used with GIT_HOST)
GIT_HOST Git host for credential storage (used with GIT_TOKEN)

Web UI (ttyd)

Variable Default Description
TTYD_USERNAME admin Web UI username
TTYD_PASSWORD Web UI password (enables ttyd web terminal when set)

AI API keys

These env vars are available to all tools inside the container — opencode, aider, vibe, and any script or custom tool.

Variable Consumed by
OPENROUTER_API_KEY opencode, aider, vibe (custom provider)
MISTRAL_API_KEY opencode, aider, vibe (default provider)
OPENAI_API_KEY opencode, aider, vibe (custom provider)
ANTHROPIC_API_KEY opencode, aider, vibe (custom provider)
GOOGLE_API_KEY opencode, aider (via --api-key), vibe (custom provider)
OLLAMA_CLOUD_API_KEY opencode (custom openai-compatible provider)

The entrypoint auto-generates ~/.config/opencode/opencode.json for any provider whose env var is set (skips if config already exists). See opencode.json.template for the full reference.

opencode.json Configuration

A template with all available settings is provided at opencode.json.template. For example, to set default models:

{
  "$schema": "https://opencode.ai/config.json",
  "model": "openrouter/poolside/laguna-m.1:free",
  "small_model": "openrouter/poolside/laguna-xs.2:free",
  "provider": { ... }
}

License

Apache 2.0 — see LICENSE.