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. --- cmd/ship/main.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cmd/ship/main.go') diff --git a/cmd/ship/main.go b/cmd/ship/main.go index a6984ec..47dd579 100644 --- a/cmd/ship/main.go +++ b/cmd/ship/main.go @@ -65,6 +65,8 @@ func init() { rootCmd.Flags().String("env-file", "", "Path to .env file") rootCmd.Flags().String("args", "", "Arguments to pass to binary") rootCmd.Flags().StringArray("file", nil, "Config file to upload to working directory (can be specified multiple times)") + rootCmd.Flags().String("memory", "", "Memory limit (e.g., 512M, 1G)") + rootCmd.Flags().String("cpu", "", "CPU limit (e.g., 50%, 200% for 2 cores)") // Add subcommands rootCmd.AddCommand(listCmd) -- cgit v1.2.3