diff --git a/docs/ides/web-ides.md b/docs/ides/web-ides.md index 35d6552755bab..ef7249df5cf1d 100644 --- a/docs/ides/web-ides.md +++ b/docs/ides/web-ides.md @@ -15,13 +15,19 @@ resources in the template. With our generic model, any web application can be used as a Coder application. For example: ```hcl -# Give template users the portainer.io web UI +# Add button to open Portainer in the workspace dashboard +# Note: Portainer must be already running in the workspace resource "coder_app" "portainer" { agent_id = coder_agent.main.id name = "portainer" icon = "https://simpleicons.org/icons/portainer.svg" - url = "http://localhost:8000" - relative_path = true + url = "https://localhost:9443/api/status" + + healthcheck { + url = "https://localhost:9443/api/status" + interval = 6 + threshold = 10 + } } ``` @@ -73,13 +79,16 @@ resource "coder_app" "code-server" { name = "code-server" url = "http://localhost:13337/?folder=/home/coder" icon = "/icon/code.svg" + + healthcheck { + url = "http://localhost:13337/healthz" + interval = 2 + threshold = 10 + } + } ``` -
-If the code-server integrated terminal fails to load, (i.e., xterm fails to load), go to DevTools to ensure xterm is loaded, clear your browser cache and refresh. -
- ## JetBrains Projector [JetBrains Projector](https://jetbrains.github.io/projector-client/mkdocs/latest/) is a JetBrains Incubator project which renders JetBrains IDEs in the web browser. @@ -106,8 +115,6 @@ Workspace requirements: - RubyMine - WebStorm -- ➕ code-server (just in case!) - For advanced users who want to make a custom image, you can install the Projector CLI in the `startup_script` of the `coder_agent` resource in a Coder template. Using the Projector CLI, you can use `projector ide autoinstall` and `projector run` to download and start a JetBrains IDE in your workspace. ![IntelliJ in Coder](../images/projector-intellij.png) @@ -176,7 +183,13 @@ resource "coder_app" "intellij" { name = "${var.jetbrains-ide}" icon = "/icon/intellij.svg" url = "http://localhost:8997/" - relative_path = true + + healthcheck { + url = "http://localhost:8997/" + interval = 6 + threshold = 20 + } + } ``` @@ -207,20 +220,31 @@ data "coder_workspace" "me" {} ## The name of the app must always be equal to the "/apps/" ## string in the base_url. This caveat is unique to Jupyter. +locals { + jupyter_base_path = "/@${data.coder_workspace.me.owner}/${data.coder_workspace.me.name}/apps/jupyter/" +} + resource "coder_agent" "coder" { os = "linux" arch = "amd64" dir = "/home/coder" startup_script = <<-EOF pip3 install jupyterlab -jupyter lab --ServerApp.base_url=/@${data.coder_workspace.me.owner}/${data.coder_workspace.me.name}/apps/jupyter/ --ServerApp.token='' --ip='*' +$HOME/.local/bin/jupyter lab --ServerApp.base_url=${local.jupyter_base_path} --ServerApp.token='' --ip='*' EOF } resource "coder_app" "jupyter" { agent_id = coder_agent.coder.id - url = "http://localhost:8888/@${data.coder_workspace.me.owner}/${data.coder_workspace.me.name}/apps/jupyter" - icon = "/icon/jupyter.svg" + name = "JupyterLab" + url = "http://localhost:8888${local.jupyter_base_path}" + icon = "/icon/jupyter.svg" + + healthcheck { + url = "http://localhost:8888${local.jupyter_base_path}" + interval = 5 + threshold = 10 + } } ``` diff --git a/dogfood/main.tf b/dogfood/main.tf index 2032adc18212e..007aee3846ce6 100644 --- a/dogfood/main.tf +++ b/dogfood/main.tf @@ -42,6 +42,12 @@ resource "coder_app" "code-server" { name = "code-server" url = "http://localhost:13337/" icon = "/icon/code.svg" + + healthcheck { + url = "http://localhost:1337/healthz" + interval = 3 + threshold = 10 + } } diff --git a/examples/templates/aws-ecs-container/main.tf b/examples/templates/aws-ecs-container/main.tf index 783279a2213b1..a63b5af3f0f42 100644 --- a/examples/templates/aws-ecs-container/main.tf +++ b/examples/templates/aws-ecs-container/main.tf @@ -110,4 +110,10 @@ resource "coder_app" "code-server" { icon = "/icon/code.svg" url = "http://localhost:13337?folder=/home/coder" relative_path = true + + healthcheck { + url = "http://localhost:1337/healthz" + interval = 3 + threshold = 10 + } } diff --git a/examples/templates/aws-linux/main.tf b/examples/templates/aws-linux/main.tf index 7d1e156d7fcd3..7ead586e05a51 100644 --- a/examples/templates/aws-linux/main.tf +++ b/examples/templates/aws-linux/main.tf @@ -90,6 +90,12 @@ resource "coder_app" "code-server" { name = "code-server" url = "http://localhost:13337/?folder=/home/coder" icon = "/icon/code.svg" + + healthcheck { + url = "http://localhost:1337/healthz" + interval = 3 + threshold = 10 + } } locals { diff --git a/examples/templates/bare/main.tf b/examples/templates/bare/main.tf index ce873984e97eb..df9eaf76ccada 100644 --- a/examples/templates/bare/main.tf +++ b/examples/templates/bare/main.tf @@ -47,4 +47,10 @@ resource "coder_app" "fake-app" { icon = "/icon/code.svg" agent_id = "fake-compute" url = "http://localhost:8080" + + healthcheck { + url = "http://localhost:1337/healthz" + interval = 3 + threshold = 10 + } } diff --git a/examples/templates/docker-code-server/main.tf b/examples/templates/docker-code-server/main.tf index 8efcbfb48092d..1c16784a9cd74 100644 --- a/examples/templates/docker-code-server/main.tf +++ b/examples/templates/docker-code-server/main.tf @@ -41,6 +41,12 @@ resource "coder_app" "code-server" { agent_id = coder_agent.main.id url = "http://localhost:8080/?folder=/home/coder" icon = "/icon/code.svg" + + healthcheck { + url = "http://localhost:8080/healthz" + interval = 3 + threshold = 10 + } } resource "docker_volume" "home_volume" { diff --git a/examples/templates/docker-image-builds/main.tf b/examples/templates/docker-image-builds/main.tf index 7ffb3991ca11a..556e1f2a21a47 100644 --- a/examples/templates/docker-image-builds/main.tf +++ b/examples/templates/docker-image-builds/main.tf @@ -38,6 +38,13 @@ resource "coder_app" "code-server" { name = "code-server" url = "http://localhost:13337/?folder=/home/coder" icon = "/icon/code.svg" + + healthcheck { + url = "http://localhost:1337/healthz" + interval = 3 + threshold = 10 + } + } variable "docker_image" { diff --git a/examples/templates/gcp-linux/main.tf b/examples/templates/gcp-linux/main.tf index 533866cd44723..b4706e3d5280e 100644 --- a/examples/templates/gcp-linux/main.tf +++ b/examples/templates/gcp-linux/main.tf @@ -65,6 +65,12 @@ resource "coder_app" "code-server" { icon = "/icon/code.svg" url = "http://localhost:13337?folder=/home/coder" relative_path = true + + healthcheck { + url = "http://localhost:1337/healthz" + interval = 3 + threshold = 10 + } } resource "google_compute_instance" "dev" { diff --git a/examples/templates/gcp-vm-container/main.tf b/examples/templates/gcp-vm-container/main.tf index 8f7bccaf81149..58ebd42050495 100644 --- a/examples/templates/gcp-vm-container/main.tf +++ b/examples/templates/gcp-vm-container/main.tf @@ -55,6 +55,12 @@ resource "coder_app" "code-server" { icon = "/icon/code.svg" url = "http://localhost:13337?folder=/home/coder" relative_path = true + + healthcheck { + url = "http://localhost:1337/healthz" + interval = 3 + threshold = 10 + } } module "gce-container" { diff --git a/examples/templates/kubernetes/main.tf b/examples/templates/kubernetes/main.tf index edcd4cce19f55..c48c78ecd13b0 100644 --- a/examples/templates/kubernetes/main.tf +++ b/examples/templates/kubernetes/main.tf @@ -76,6 +76,12 @@ resource "coder_app" "code-server" { icon = "/icon/code.svg" url = "http://localhost:13337?folder=/home/coder" relative_path = true + + healthcheck { + url = "http://localhost:1337/healthz" + interval = 3 + threshold = 10 + } } resource "kubernetes_persistent_volume_claim" "home" {