File tree 9 files changed +93
-3
lines changed
9 files changed +93
-3
lines changed Original file line number Diff line number Diff line change @@ -68,3 +68,9 @@ instances provisioned by Coder:
68
68
]
69
69
}
70
70
```
71
+
72
+ ## code-server
73
+
74
+ ` code-server ` is installed via the ` startup_script ` argument in the ` coder_agent `
75
+ resource block. The ` coder_app ` resource is defined to access ` code-server ` through
76
+ the dashboard UI over ` localhost:13337 ` .
Original file line number Diff line number Diff line change @@ -76,6 +76,20 @@ resource "coder_agent" "main" {
76
76
arch = " amd64"
77
77
auth = " aws-instance-identity"
78
78
os = " linux"
79
+ startup_script = << EOT
80
+ #!/bin/bash
81
+
82
+ # install and start code-server
83
+ curl -fsSL https://code-server.dev/install.sh | sh | tee code-server-install.log
84
+ code-server --auth none --port 13337 | tee code-server-install.log &
85
+ EOT
86
+ }
87
+
88
+ resource "coder_app" "code-server" {
89
+ agent_id = coder_agent. main . id
90
+ name = " code-server"
91
+ url = " http://localhost:13337/?folder=/home/coder"
92
+ icon = " /icon/code.svg"
79
93
}
80
94
81
95
locals {
Original file line number Diff line number Diff line change @@ -146,6 +146,12 @@ coder ls
146
146
coder update [workspace name]
147
147
```
148
148
149
+ ## code-server
150
+
151
+ ` code-server ` is installed via the ` startup_script ` argument in the ` coder_agent `
152
+ resource block. The ` coder_app ` resource is defined to access ` code-server ` through
153
+ the dashboard UI over ` localhost:13337 ` .
154
+
149
155
## Extending this template
150
156
151
157
See the [ kreuzwerker/docker] ( https://registry.terraform.io/providers/kreuzwerker/docker ) Terraform provider documentation to
Original file line number Diff line number Diff line change @@ -24,6 +24,20 @@ data "coder_workspace" "me" {
24
24
resource "coder_agent" "main" {
25
25
arch = data. coder_provisioner . me . arch
26
26
os = " linux"
27
+ startup_script = << EOT
28
+ #!/bin/bash
29
+
30
+ # install and start code-server
31
+ curl -fsSL https://code-server.dev/install.sh | sh | tee code-server-install.log
32
+ code-server --auth none --port 13337 | tee code-server-install.log &
33
+ EOT
34
+ }
35
+
36
+ resource "coder_app" "code-server" {
37
+ agent_id = coder_agent. main . id
38
+ name = " code-server"
39
+ url = " http://localhost:13337/?folder=/home/coder"
40
+ icon = " /icon/code.svg"
27
41
}
28
42
29
43
variable "docker_image" {
Original file line number Diff line number Diff line change @@ -43,6 +43,12 @@ coder template push docker
43
43
You can also remove images from the validation list. Workspaces using older template versions will continue using
44
44
the removed image until you update the workspace to the latest version.
45
45
46
+ ## code-server
47
+
48
+ ` code-server ` is installed via the ` startup_script ` argument in the ` coder_agent `
49
+ resource block. The ` coder_app ` resource is defined to access ` code-server ` through
50
+ the dashboard UI over ` localhost:13337 ` .
51
+
46
52
## Updating images
47
53
48
54
To reduce drift, we recommend versioning images in your registry by creating tags. To update the image tag in the template:
Original file line number Diff line number Diff line change @@ -43,3 +43,9 @@ a service account:
43
43
44
44
1 . Generate a ** JSON private key** , which will be what you provide to Coder
45
45
during the setup process.
46
+
47
+ ## code-server
48
+
49
+ ` code-server ` is installed via the ` startup_script ` argument in the ` coder_agent `
50
+ resource block. The ` coder_app ` resource is defined to access ` code-server ` through
51
+ the dashboard UI over ` localhost:13337 ` .
Original file line number Diff line number Diff line change @@ -46,9 +46,25 @@ resource "google_compute_disk" "root" {
46
46
}
47
47
48
48
resource "coder_agent" "main" {
49
- auth = " google-instance-identity"
50
- arch = " amd64"
51
- os = " linux"
49
+ auth = " google-instance-identity"
50
+ arch = " amd64"
51
+ os = " linux"
52
+ startup_script = << EOT
53
+ #!/bin/bash
54
+
55
+ # install and start code-server
56
+ curl -fsSL https://code-server.dev/install.sh | sh | tee code-server-install.log
57
+ code-server --auth none --port 13337 | tee code-server-install.log &
58
+ EOT
59
+ }
60
+
61
+ # code-server
62
+ resource "coder_app" "code-server" {
63
+ agent_id = coder_agent. main . id
64
+ name = " code-server"
65
+ icon = " /icon/code.svg"
66
+ url = " http://localhost:13337?folder=/home/coder"
67
+ relative_path = true
52
68
}
53
69
54
70
resource "google_compute_instance" "dev" {
Original file line number Diff line number Diff line change @@ -43,3 +43,9 @@ a service account:
43
43
44
44
1 . Generate a ** JSON private key** , which will be what you provide to Coder
45
45
during the setup process.
46
+
47
+ ## code-server
48
+
49
+ ` code-server ` is installed via the ` startup_script ` argument in the ` coder_agent `
50
+ resource block. The ` coder_app ` resource is defined to access ` code-server ` through
51
+ the dashboard UI over ` localhost:13337 ` .
Original file line number Diff line number Diff line change @@ -39,6 +39,22 @@ resource "coder_agent" "main" {
39
39
auth = " google-instance-identity"
40
40
arch = " amd64"
41
41
os = " linux"
42
+ startup_script = << EOT
43
+ #!/bin/bash
44
+
45
+ # install and start code-server
46
+ curl -fsSL https://code-server.dev/install.sh | sh | tee code-server-install.log
47
+ code-server --auth none --port 13337 | tee code-server-install.log &
48
+ EOT
49
+ }
50
+
51
+ # code-server
52
+ resource "coder_app" "code-server" {
53
+ agent_id = coder_agent. main . id
54
+ name = " code-server"
55
+ icon = " /icon/code.svg"
56
+ url = " http://localhost:13337?folder=/home/coder"
57
+ relative_path = true
42
58
}
43
59
44
60
module "gce-container" {
You can’t perform that action at this time.
0 commit comments