From 85e97bf1ebe339513ab0661f6cc1ab1ff17a46cb Mon Sep 17 00:00:00 2001 From: bndw Date: Sun, 25 Jan 2026 08:06:56 -0800 Subject: 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. --- internal/state/state.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'internal/state/state.go') diff --git a/internal/state/state.go b/internal/state/state.go index c6de34a..38657cb 100644 --- a/internal/state/state.go +++ b/internal/state/state.go @@ -22,12 +22,14 @@ type Host struct { // App represents a deployed application or static site type App struct { - Type string `json:"type"` // "app" or "static" + Type string `json:"type"` // "app" or "static" Domain string `json:"domain"` - Port int `json:"port,omitempty"` // only for type="app" - Env map[string]string `json:"env,omitempty"` // only for type="app" - Args string `json:"args,omitempty"` // only for type="app" - Files []string `json:"files,omitempty"` // only for type="app" + Port int `json:"port,omitempty"` // only for type="app" + Env map[string]string `json:"env,omitempty"` // only for type="app" + Args string `json:"args,omitempty"` // only for type="app" + Files []string `json:"files,omitempty"` // only for type="app" + Memory string `json:"memory,omitempty"` // only for type="app" + CPU string `json:"cpu,omitempty"` // only for type="app" } const ( -- cgit v1.2.3