Reusable Coder workspace templates for different project types.
| Template | Runtime | Use Case |
|---|---|---|
base |
Ubuntu + Docker-in-Docker | Foundation for all templates |
dind |
Docker-in-Docker | General-purpose workspaces with Claude Code |
desktop |
XFCE + VNC | GUI desktop environment |
openclaw |
Node.js + AI tools | AI agent development |
Reference the module in your project's infra/coder/main.tf:
module "workspace" {
source = "git::https://github.com/codewiresh/templates.git//dind/module?ref=v1.1.12"
project_name = "myproject"
git_repos = { "myproject" = "https://github.com/myorg/myproject.git" }
services = {
app = { port = 8081, public = true, healthcheck = true }
api = { port = 3000, public = false, healthcheck = true }
}
startup_hook = "scripts/startup.sh"
install_command = "bun install"
claude_code_oauth_token = var.claude_code_oauth_token
dockerhub_username = var.dockerhub_username
dockerhub_token = var.dockerhub_token
}
variable "claude_code_oauth_token" {
type = string
sensitive = true
default = ""
}
variable "dockerhub_username" {
type = string
sensitive = true
default = ""
}
variable "dockerhub_token" {
type = string
sensitive = true
default = ""
}Images are automatically built and pushed to ghcr.io/codewiresh/ on push to main via GitHub Actions.
Manual build:
docker build -t ghcr.io/codewiresh/coder-base:latest -f base/Dockerfile .
docker build -t ghcr.io/codewiresh/coder-dind:latest -f dind/Dockerfile .templates/
├── base/ # Shared base image
│ ├── Dockerfile
│ ├── docker-archive-keyring.gpg
│ ├── docker.list
│ └── scripts/ # Common setup scripts
├── dind/ # Docker-in-Docker template
│ ├── Dockerfile # FROM base, adds Docker
│ ├── module/ # Terraform module
│ │ └── main.tf
│ └── scripts/ # setup-docker, start-vnc, etc.
├── desktop/ # XFCE desktop environment
│ ├── Dockerfile # FROM dind, adds XFCE + VNC
│ └── scripts/
├── openclaw/ # AI agent development
│ ├── Dockerfile # FROM desktop, adds Node.js
│ ├── module/
│ │ └── main.tf
│ └── scripts/
└── .github/workflows/
└── build-images.yaml
Templates support auto-launching workspaces when a GitHub issue is labeled. The dind template includes built-in parameters for issue metadata (issue_number, issue_title, issue_branch, ai_prompt).
When an issue gets the launch-codespace label, a GitHub Action creates a Coder workspace with an AI agent that starts working on the issue automatically.
Setup requires:
- A Coder API token stored as
CODER_TOKENGitHub secret - A
launch-codespacelabel on the repo - A GitHub Action workflow that calls
coder createwith issue parameters .claude/settings.jsonandCLAUDE.mdfor AI agent configuration
See the example repo's setup guide for full instructions.
- Create a new directory:
mkdir mytemplate - Create
Dockerfileextending base:FROM ghcr.io/codewiresh/coder-base:latest - Add runtime-specific setup
- Create
module/main.tfwith the Terraform module - Add to workflow for CI builds