This repository demonstrates how to run OpenCode inside a ShinyProxy container.
The UI included in the official OpenCode Docker image uses absolute paths for its resources which is not compatible with ShinyProxy's reverse proxy. For this reason, we use an alternative ui that uses prefix aware resource paths (prokube/pk-opencode-webui).
By default, OpenCode provides OpenCode Zen as a default server. This Docker image
is ready to be used with Ollama, allowing you to use your
local models!
The AI-assisted coding world is moving fast, therefore this specific demo is also quite experimental. For example, it's not using the official OpenCode web-ui (see above). Please verify this setup yourselves before deploying it in production.
To build the Docker image, run the following command:
docker build -t openanalytics/shinyproxy-opencode-demo .
To configure ShinyProxy to use this image, add the following to your application.yml file:
proxy:
specs:
- id: opencode
name: opencode
display-name: OpenCode
container-image: openanalytics/shinyproxy-opencode-demo
port: 8000Persistent storage can be configured using the container-volumes field in the application.yml file:
proxy:
specs:
- id: opencode
name: opencode
display-name: OpenCode
container-image: openanalytics/shinyproxy-opencode-demo
port: 8000
container-volumes: [ "/tmp/opencode/#{proxy.userId}/work:/home/opencode/workspace"]It is possible to combine OpenCode with other apps in ShinyProxy by mounting the
same container-volumes in both the OpenCode spec and the spec for the other
app. For example, you could launch a VS Code
instance that shares the same persistent storage as OpenCode. This way OpenCode
can be used as an agent for the VS Code instance.
To use this image with an existing Ollama instance, specify the OLLAMA_ENDPOINT environment variable:
proxy:
specs:
- id: opencode
name: opencode
display-name: OpenCode
container-image: openanalytics/shinyproxy-opencode-demo
port: 8000
container-env:
OLLAMA_ENDPOINT: "http://172.17.0.1:11434/v1"When running this demo in ShinyProxy, you may see an exception of type
java.nio.channels.ClosedChannelException being logged. OpenCode use Server
Side Events (SSE), these connections are sometimes not fully closed and cause
the exception. This does not cause any problems with the app. A future version
of ShinyProxy might hide this warning.
(c) Copyright Open Analytics NV, 2026.


