summaryrefslogtreecommitdiffstats
path: root/cmd/ship/main.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 /cmd/ship/main.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 'cmd/ship/main.go')
-rw-r--r--cmd/ship/main.go2
1 files changed, 2 insertions, 0 deletions
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() {
65 rootCmd.Flags().String("env-file", "", "Path to .env file") 65 rootCmd.Flags().String("env-file", "", "Path to .env file")
66 rootCmd.Flags().String("args", "", "Arguments to pass to binary") 66 rootCmd.Flags().String("args", "", "Arguments to pass to binary")
67 rootCmd.Flags().StringArray("file", nil, "Config file to upload to working directory (can be specified multiple times)") 67 rootCmd.Flags().StringArray("file", nil, "Config file to upload to working directory (can be specified multiple times)")
68 rootCmd.Flags().String("memory", "", "Memory limit (e.g., 512M, 1G)")
69 rootCmd.Flags().String("cpu", "", "CPU limit (e.g., 50%, 200% for 2 cores)")
68 70
69 // Add subcommands 71 // Add subcommands
70 rootCmd.AddCommand(listCmd) 72 rootCmd.AddCommand(listCmd)