module

Yozgat::Deploy::Ports

Constants

ALLOC_MAX = 8999
ALLOC_MIN = 8000

Auto-allocation keeps to a high block so it never grabs system/privileged ports. Users can still set any port in PORT_MIN..PORT_MAX explicitly.

PORT_MAX = 65535
PORT_MIN = 1

Class methods

allocate
Source
current_effective_port(project_id : Int64, env_id : Int64) : NamedTuple(deployment_id: Int64 | Nil, port: Int64 | Nil) | Nil

The host port the CURRENT deployment's compose file actually publishes, read from the latest deployment on disk. This is the source of truth for repo-controlled (dockercompose) projects — the environment's host_port can be stale if a deploy failed before syncing.

Source
in_use?(port : Int64, exclude_environment_id : Int64) : Bool
Source
resolve_for_environment(project_id : Int64, environment_id : Int64) : Int64
Source
valid?(port : Int64) : Bool
Source