A Discord bot, a website, and a sandboxed OpenCode agent - all in one container. The agent can modify the bot's and the website's source at runtime. Destructive edits are automatically recovered via an internal git repo and a crash-loop watchdog.
Required .env at the repo root (see .env.example):
DISCORD_BOT_TOKENDISCORD_PUBLIC_KEYDISCORD_APPLICATION_IDOPENCODE_SERVER_PASSWORD(used by the bot to talk to OpenCode)
Then:
docker compose up --build
- Website: http://localhost:3000
- Bot webhook: http://localhost:3001/api/webhooks/discord
- Supervisor health: http://127.0.0.1:3002/supervisor/health (internal only; exec into the container to hit it)
- Container runs as user
appafter setup; OpenCode runs asagent. infra/is root-owned and unwritable to the agent.src/is agent-editable. Changes are auto-committed to/workspace/.git.- A supervisor watches source, restarts processes on change, and
git reset --hards to the last healthy commit if either process crash-loops.
src/website/: SSR React sitesrc/discordbot/: Discord bot that proxies to OpenCodeinfra/: Dockerfile, supervisor, entrypoint, rulesdocs/: specs and plans