Skip to content

Commit 264fc32

Browse files
committed
feat: add Coder Tasks example
1 parent eb27843 commit 264fc32

File tree

7 files changed

+557
-1
lines changed

7 files changed

+557
-1
lines changed
Lines changed: 25 additions & 0 deletions
Loading
1.37 MB
Loading
Lines changed: 5 additions & 0 deletions
Loading

registry/coder-labs/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
display_name: Coder Labs
3+
bio: Collection of example templates and modules for Coder. Designed for reference, not production use.
4+
github: coder
5+
avatar: ./.images/avatar.svg
6+
linkedin: https://www.linkedin.com/company/coderhq
7+
website: https://discord.gg/coder
8+
status: community
9+
---å
10+
11+
# Coder Labs
12+
13+
Collection of example templates and modules for Coder. Designed for reference, not production use.
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
display_name: Tasks on Docker
3+
description: Run Coder Tasks on Docker with an example application
4+
icon: ./.images/tasks.svg
5+
maintainer_github: coder
6+
verified: false
7+
tags: [docker, container, ai, tasks]
8+
---
9+
10+
# Run Coder Tasks on Docker
11+
12+
This is an example template for running [Coder Tasks](https://coder.com/docs/ai-coder/tasks), Claude Code, along with a [real world application](https://realworld-docs.netlify.app/).
13+
14+
![Tasks](../../.images/tasks-screenshot.png)
15+
16+
This is a fantastic starting point for working with AI agents with Coder Tasks. Try prompts such as:
17+
18+
- "Make the background color blue"
19+
- "Add a dark mode"
20+
- "Rewrite the entire backend in Go"
21+
22+
## Included in this template
23+
24+
This template is designed to be an example and a reference for building other templates with Coder Tasks. You can always run Coder Tasks on different infrastructure (e.g. as on Kubernetes, VMs) and with your own GitHub repositories, MCP servers, images, etc.
25+
26+
Additionally, this template uses our [Claude Code](https://registry.coder.com/modules/coder/claude-code) module, but [other agents](https://registry.coder.com/modules?search=tag%3Aagent) or even [custom agents](https://coder.com/docs/ai-coder/custom-agents) can be used in its place.
27+
28+
This template uses a [Workspace Preset](https://coder.com/docs/admin/templates/extending-templates/parameters#workspace-presets) that pre-defines:
29+
30+
- Universal Container Image (e.g. contains Node.js, Java, Python, Ruby, etc)
31+
- MCP servers (desktop-commander for long-running logs, playwright for previewing changes)
32+
- System prompt and [repository](https://github.com/coder-contrib/realworld-django-rest-framework-angular) for the AI agent
33+
- Startup script to initialize the repository and start the development server
34+
35+
## Add this template to your Coder deployment
36+
37+
You can also add this template to your Coder deployment and begin tinkering right away!
38+
39+
### Prerequisites
40+
41+
- Coder installed (see [our docs](https://coder.com/docs/install)), ideally a Linux VM with Docker
42+
- Anthropic API Key (or access to Anthropic models via Bedrock or Vertex, see [Claude Code docs](https://docs.anthropic.com/en/docs/claude-code/third-party-integrations))
43+
- Access to a Docker socket
44+
- If on the local VM, ensure the `coder` user is added to the Docker group (docs)
45+
```sh
46+
# Add coder user to Docker group
47+
sudo adduser coder docker
48+
49+
# Restart Coder server
50+
sudo systemctl restart coder
51+
52+
# Test Docker
53+
sudo -u coder docker ps
54+
```
55+
- If on a remote VM, see the [Docker Terraform provider documentation](https://registry.terraform.io/providers/kreuzwerker/docker/latest/docs#remote-hosts) to configure a remote host
56+
57+
58+
To import this template into Coder, first create a template from "Scratch" in the template editor.
59+
60+
Visit this URL for your Coder deployment:
61+
62+
```sh
63+
https://coder.example.com/templates/new?exampleId=scratch
64+
```
65+
66+
After creating the template, paste the contents from [main.tf](./main.tf) into the template editor and save.
67+
68+
Alternatively, you can use the Coder CLI to [push the template](https://coder.com/docs/reference/cli/templates_push)
69+
70+
```sh
71+
# Download the CLI
72+
curl -L https://coder.com/install.sh | sh
73+
74+
# Log in to your deployment
75+
coder login https://coder.example.com
76+
77+
# Clone the registry
78+
git clone https://github.com/coder/registry
79+
cd registry
80+
81+
# Navigate to this template
82+
cd registry/coder-labs/templates/tasks-docker
83+
84+
# Push the template
85+
coder templates push
86+
```
87+

0 commit comments

Comments
 (0)