File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -357,6 +357,14 @@ resource "coder_agent" "dev" {
357
357
cd "${ local . repo_dir } " && make clean
358
358
cd "${ local . repo_dir } /site" && pnpm install
359
359
EOT
360
+
361
+ shutdown_script = <<- EOT
362
+ #!/usr/bin/env bash
363
+ set -eux -o pipefail
364
+
365
+ # Stop the Docker service to prevent errors during workspace destroy.
366
+ sudo service docker stop
367
+ EOT
360
368
}
361
369
362
370
# Add a cost so we get some quota usage in dev.coder.com
@@ -418,6 +426,10 @@ resource "docker_container" "workspace" {
418
426
# CPU limits are unnecessary since Docker will load balance automatically
419
427
memory = data. coder_workspace_owner . me . name == " code-asher" ? 65536 : 32768
420
428
runtime = " sysbox-runc"
429
+ # Ensure the workspace is given time to execute shutdown scripts.
430
+ destroy_grace_seconds = 60
431
+ stop_timeout = 60
432
+ stop_signal = " SIGINT"
421
433
env = [
422
434
" CODER_AGENT_TOKEN=${ coder_agent . dev . token } " ,
423
435
" USE_CAP_NET_ADMIN=true" ,
You can’t perform that action at this time.
0 commit comments