port binding
An app offering its service by listening on a network port itself, with its own web server built in.
In more detail
Factor VII of the twelve-factor app: the app is self-contained, binds the port the platform chooses and speaks a protocol over it, and that is its whole contract with the execution environment. The violation is the older model of injecting the app into an external application server.
Example
return int(os.environ["PORT"]) # VII: the platform hands the port downRelated terms
- port — A number from 1 to 65535 that picks out one service on a machine, such as 22 for SSH or 80 for plain web traffic.
- web server — A program that listens for web requests on a port and sends back responses.
- application server — A long-running server, such as Apache Tomcat, that applications are deployed into as modules rather than running on their own.
- config — Everything about an application that varies between deploys, such as database addresses, credentials and hostnames.
Taught in
- Port Binding And Concurrency — DevOps & Site Reliability Engineering