diff options
| author | Clawd <ai@clawd.bot> | 2026-02-17 07:59:50 -0800 |
|---|---|---|
| committer | Clawd <ai@clawd.bot> | 2026-02-17 07:59:50 -0800 |
| commit | d97bb6f53eefd2139115d39bca7e17d565222472 (patch) | |
| tree | 428f230dffad49d166bc521609dd3ee236a42010 /cmd/ship/deploy_v2.go | |
| parent | 3e34265c8a6ea1ec300f987206afb25bad645677 (diff) | |
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/<name>
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.
Diffstat (limited to 'cmd/ship/deploy_v2.go')
| -rw-r--r-- | cmd/ship/deploy_v2.go | 17 |
1 files changed, 9 insertions, 8 deletions
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) { | |||
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | type deployV2Options struct { | 145 | type deployV2Options struct { |
| 146 | Name string | 146 | Name string |
| 147 | Host string | 147 | Host string |
| 148 | Domain string | 148 | Domain string |
| 149 | Health string | 149 | Health string |
| 150 | TTL string | 150 | TTL string |
| 151 | Env []string | 151 | Env []string |
| 152 | EnvFile string | 152 | EnvFile string |
| 153 | Pretty bool | 153 | ContainerPort int // Port the container listens on (default 80 for Docker) |
| 154 | Pretty bool | ||
| 154 | } | 155 | } |
| 155 | 156 | ||
| 156 | // deployContext holds all info needed for a deploy | 157 | // deployContext holds all info needed for a deploy |
