Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9cd74f3

Browse files
sharkymarkbpmct
andauthored
chore: update port forward dashboard docs for coder_app, sharing, and showing running processes (coder#4876)
* chore: update port forward dashboard docs for coder_app and sharing * Update docs/networking/port-forwarding.md Co-authored-by: Ben Potter <[email protected]>
1 parent 7f0f522 commit 9cd74f3

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

docs/images/coderapp-port-forward.png

159 KB
Loading

docs/networking/port-forwarding.md

+30-2
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,39 @@ For more examples, see `coder port-forward --help`.
4747
> To enable port forwarding via the dashboard, Coder must be configured with a
4848
> [wildcard access URL](../admin/configure.md#wildcard-access-url).
4949
50-
Use the "Port forward" button in the dashboard to access ports
51-
running on your workspace.
50+
### From an arbitrary port
51+
52+
One way to port forward in the dashboard is to use the "Port forward" button to specify an arbitrary port. Coder will also detect if processes are running, and will list them below the port picklist to click an open the running processes in the browser.
5253

5354
![Port forwarding in the UI](../images/port-forward-dashboard.png)
5455

56+
### From an coder_app resource
57+
58+
Another way to port forward is to configure a `coder_app` resource in the workspace's template. This approach shows a visual application icon in the dashboard. See the following `coder_app` example for a Node React app and note the `subdomain` and `share` settings:
59+
60+
```sh
61+
# node app
62+
resource "coder_app" "node-react-app" {
63+
agent_id = coder_agent.dev.id
64+
name = "node-react-app"
65+
icon = "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/React-icon.svg/2300px-React-icon.svg.png"
66+
url = "http://localhost:3000"
67+
subdomain = true
68+
share = "authenticated"
69+
70+
healthcheck {
71+
url = "http://localhost:3000/healthz"
72+
interval = 10
73+
threshold = 30
74+
}
75+
76+
}
77+
```
78+
79+
Valid `share` values include `owner` - private to the user, `authenticated` - accessible by any user authenticated to the Coder deployment, and `public` - accessible by users outside of the Coder deployment.
80+
81+
![Port forwarding from an app in the UI](../images/coderapp-port-forward.png)
82+
5583
## SSH
5684

5785
First, [configure SSH](../ides.md#ssh-configuration) on your

0 commit comments

Comments
 (0)