Skip to content

Commit fed35bf

Browse files
committed
ttyd+broadwayd+emacs+code-server
1 parent 2bc2746 commit fed35bf

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

templates/emacs-pod/main.tf

+25-2
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,16 @@ resource "coder_agent" "main" {
5555
# start ttyd / tmux
5656
tmux new -d
5757
ttyd tmux at 2>&1 | tee ttyd.log &
58+
# install and start code-server
59+
curl -fsSL https://code-server.dev/install.sh | sh | tee code-server-install.log
60+
code-server --auth none --port 13337 | tee code-server-install.log &
61+
5862
EOT
5963
}
6064

6165
# emacs-broadway
6266
resource "coder_app" "emacs-broadway" {
63-
subdomain = true
67+
subdomain = false
6468
share = "public"
6569
agent_id = coder_agent.main.id
6670
slug = "emacs-broadway"
@@ -78,7 +82,7 @@ resource "coder_app" "emacs-broadway" {
7882

7983
# ttyd
8084
resource "coder_app" "ttyd" {
81-
subdomain = true
85+
subdomain = false
8286
share = "public"
8387
slug = "ttyd"
8488
display_name = "ttyd for tmux"
@@ -104,11 +108,30 @@ resource "coder_app" "tmux" {
104108
share = "public"
105109
}
106110

111+
# code-server
112+
resource "coder_app" "code-server" {
113+
agent_id = coder_agent.main.id
114+
display_name = "code-server"
115+
slug = "code-server"
116+
icon = "/icon/code.svg"
117+
url = "http://localhost:13337?folder=/home/coder"
118+
subdomain = false
119+
120+
# healthcheck {
121+
# url = "http://localhost:13337/healthz"
122+
# interval = 3
123+
# threshold = 10
124+
# }
125+
}
126+
107127
resource "kubernetes_pod" "main" {
108128
count = data.coder_workspace.me.start_count
109129
metadata {
110130
name = "coder-${lower(data.coder_workspace.me.owner)}-${lower(data.coder_workspace.me.name)}"
111131
namespace = var.namespace
132+
labels = {
133+
name = "coder-${lower(data.coder_workspace.me.owner)}-${lower(data.coder_workspace.me.name)}"
134+
}
112135
}
113136
spec {
114137
security_context {

0 commit comments

Comments
 (0)