summaryrefslogtreecommitdiffstats
path: root/internal/templates/templates.go
diff options
context:
space:
mode:
authorbndw <ben@bdw.to>2026-01-25 08:06:56 -0800
committerbndw <ben@bdw.to>2026-01-25 08:06:56 -0800
commit85e97bf1ebe339513ab0661f6cc1ab1ff17a46cb (patch)
treebd65f952b632375d0512aaf32ce17fd79ae1b262 /internal/templates/templates.go
parent8a3cff0dd7eb88cadb73a6df4e14f85450d63317 (diff)
Add CPU and memory limits for apps
Adds --memory and --cpu flags to set systemd resource limits: ship --binary ./app --memory 512M --cpu 100% Also adds config update mode - use --name without --binary to update an existing app's config without redeploying the binary: ship --name myapp --cpu 50% ship --name myapp --memory 256M --env DEBUG=true Limits are stored in state and preserved on redeploy.
Diffstat (limited to 'internal/templates/templates.go')
-rw-r--r--internal/templates/templates.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/templates/templates.go b/internal/templates/templates.go
index feb6c10..ce1cbe5 100644
--- a/internal/templates/templates.go
+++ b/internal/templates/templates.go
@@ -19,6 +19,12 @@ Restart=always
19RestartSec=5s 19RestartSec=5s
20NoNewPrivileges=true 20NoNewPrivileges=true
21PrivateTmp=true 21PrivateTmp=true
22{{- if .Memory}}
23MemoryMax={{.Memory}}
24{{- end}}
25{{- if .CPU}}
26CPUQuota={{.CPU}}
27{{- end}}
22 28
23[Install] 29[Install]
24WantedBy=multi-user.target 30WantedBy=multi-user.target