From d97bb6f53eefd2139115d39bca7e17d565222472 Mon Sep 17 00:00:00 2001 From: Clawd Date: Tue, 17 Feb 2026 07:59:50 -0800 Subject: Fix port collision bug, add --container-port flag Port allocation: - Use atomic flock-based allocation via /etc/ship/next_port - Prevents race conditions when multiple deploys run concurrently - Each app still gets its port stored in /etc/ship/ports/ Docker container port: - Add --container-port flag (default 80) - Template now uses {{.ContainerPort}} instead of hardcoded 80 - Supports containers that listen on 8080, 3000, etc. --- cmd/ship/deploy_v2.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'cmd/ship/deploy_v2.go') diff --git a/cmd/ship/deploy_v2.go b/cmd/ship/deploy_v2.go index b636709..7d498b2 100644 --- a/cmd/ship/deploy_v2.go +++ b/cmd/ship/deploy_v2.go @@ -143,14 +143,15 @@ func deployV2(path string, opts deployV2Options) { } type deployV2Options struct { - Name string - Host string - Domain string - Health string - TTL string - Env []string - EnvFile string - Pretty bool + Name string + Host string + Domain string + Health string + TTL string + Env []string + EnvFile string + ContainerPort int // Port the container listens on (default 80 for Docker) + Pretty bool } // deployContext holds all info needed for a deploy -- cgit v1.2.3