@@ -334,12 +334,7 @@ resource "coder_agent" "main" {
334
334
startup_script = <<- EOT
335
335
set -e
336
336
337
- # Install the latest code-server.
338
- # Append "--version x.x.x" to install a specific version of code-server.
339
- curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server
340
-
341
- # Start code-server in the background.
342
- /tmp/code-server/bin/code-server --auth none --port 13337 >/tmp/code-server.log 2>&1 &
337
+ # Add any commands that should be executed at workspace startup (e.g install requirements, start a program, etc) here
343
338
EOT
344
339
dir = " /workspaces"
345
340
@@ -421,20 +416,36 @@ resource "coder_agent" "main" {
421
416
}
422
417
}
423
418
424
- resource "coder_app" "code-server" {
425
- agent_id = coder_agent. main . id
426
- slug = " code-server"
427
- display_name = " code-server"
428
- url = " http://localhost:13337/?folder=/workspaces"
429
- icon = " /icon/code.svg"
430
- subdomain = false
431
- share = " owner"
432
-
433
- healthcheck {
434
- url = " http://localhost:13337/healthz"
435
- interval = 5
436
- threshold = 6
437
- }
419
+ # See https://registry.coder.com/modules/code-server
420
+ module "code-server" {
421
+ count = data. coder_workspace . me . start_count
422
+ source = " registry.coder.com/modules/code-server/coder"
423
+
424
+ # This ensures that the latest version of the module gets downloaded, you can also pin the module version to prevent breaking changes in production.
425
+ version = " >= 1.0.0"
426
+
427
+ agent_id = coder_agent. main . id
428
+ order = 1
429
+ }
430
+
431
+ # See https://registry.coder.com/modules/jetbrains-gateway
432
+ module "jetbrains_gateway" {
433
+ count = data. coder_workspace . me . start_count
434
+ source = " registry.coder.com/modules/jetbrains-gateway/coder"
435
+
436
+ # JetBrains IDEs to make available for the user to select
437
+ jetbrains_ides = [" IU" , " PY" , " WS" , " PS" , " RD" , " CL" , " GO" , " RM" ]
438
+ default = " IU"
439
+
440
+ # Default folder to open when starting a JetBrains IDE
441
+ folder = " /home/coder"
442
+
443
+ # This ensures that the latest version of the module gets downloaded, you can also pin the module version to prevent breaking changes in production.
444
+ version = " >= 1.0.0"
445
+
446
+ agent_id = coder_agent. main . id
447
+ agent_name = " main"
448
+ order = 2
438
449
}
439
450
440
451
resource "coder_metadata" "container_info" {
0 commit comments