Skip to content

Commit 0d37ff9

Browse files
authored
move code-server to module
1 parent a49df65 commit 0d37ff9

File tree

1 file changed

+5
-24
lines changed
  • examples/templates/gcp-vm-devcontainer

1 file changed

+5
-24
lines changed

examples/templates/gcp-vm-devcontainer/main.tf

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,7 @@ resource "coder_agent" "dev" {
8686
os = "linux"
8787
dir = "/worskpaces"
8888
connection_timeout = 0
89-
startup_script_timeout = 180
90-
startup_script = <<-EOT
91-
set -e
92-
93-
# install and start code-server
94-
curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server
95-
/tmp/code-server/bin/code-server --auth none --port 13337 >/tmp/code-server.log 2>&1 &
96-
EOT
97-
89+
9890
metadata {
9991
key = "cpu"
10092
display_name = "CPU Usage"
@@ -118,21 +110,10 @@ resource "coder_agent" "dev" {
118110
}
119111
}
120112

121-
resource "coder_app" "code-server" {
122-
count = data.coder_workspace.me.start_count
123-
agent_id = coder_agent.dev[0].id
124-
slug = "code-server"
125-
display_name = "code-server"
126-
icon = "/icon/code.svg"
127-
url = "http://localhost:13337?folder=/home/coder"
128-
subdomain = false
129-
share = "owner"
130-
131-
healthcheck {
132-
url = "http://localhost:13337/healthz"
133-
interval = 3
134-
threshold = 10
135-
}
113+
module "code-server" {
114+
count = data.coder_workspace.me.start_count
115+
source = "https://registry.coder.com/modules/code-server"
116+
agent_id = coder_agent.dev[0].id
136117
}
137118

138119
resource "google_compute_instance" "vm" {

0 commit comments

Comments
 (0)