Skip to content

Commit bfee554

Browse files
committed
wikistuff
1 parent f1e03c4 commit bfee554

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

docs/templates/writing/index.md

+37
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,40 @@ resource "docker_container" "workspace" {
6161
```
6262

6363
Agents can also run startup scripts, set environment variables, and provide metadata about the workspace (e.g. CPU usage). Read the [coder_agent docs](https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#startup_script) for more details.
64+
65+
### coder_app
66+
67+
Web apps that are running inside the workspace (e.g. `http://localhost:8080`) can be forwarded to the Coder dashboard with the `coder_app` resource. This is commonly used for [web IDEs](../ides/web-ides.md) such as code-server, RStudio, and JupyterLab. External apps, such as links to internal wikis or cloud consoles can also be embedded here.
68+
69+
Apps are rendered on the workspace page:
70+
71+
![]()
72+
73+
74+
```hcl
75+
# coder_agent will install and start code-server
76+
resource "coder_agent" "main" {
77+
# ...
78+
startup_script =<<EOF
79+
curl -L https://code-server.dev/install.sh | sh
80+
code-server --port 8080 &
81+
EOF
82+
}
83+
84+
# expose code-server on workspace via a coder_app
85+
resource "coder_app" "code-server" {
86+
icon = "/icon/code.svg"
87+
name = "code-server"
88+
slug = "code"
89+
url = "http://localhost:8080"
90+
}
91+
92+
# link to an external site
93+
resource "coder_app" "getting-started" {
94+
icon = "/icon/help.svg"
95+
name = "getting-started"
96+
slug = "getting-started"
97+
url = "https://wiki.example.com/coder/quickstart"
98+
external = true
99+
}
100+
```

0 commit comments

Comments
 (0)