H4: Second half of the 12-factor app

Rodney Osodo
7 min readOct 18, 2021

There must be a beginning of any great matter, but the continuing unto the end until it be thoroughly finished yields the true glory.

- Francis Drake

The previous blog is at: “H3: First half of the 12-factor app

7. Port binding

80 & 8010

The 12-factor application must be self-contained and bind to a port that is provided in the environment variable. It can’t rely on a web container like tomcat or unicorn being injected; instead, it must incorporate a server like jetty or thin. Requests from a public-facing hostname are sent through the execution environment to the port-bound web process.
With most embedded web servers, this is a simple task. If you’re already utilising an external web server, supporting an embedded server within your application may take extra effort.

From: https://pics.me.me/thumb_tcp-vs-udp-72027733.png

For the frontend application, IoT application, we are binding port 80 so that the end-user can interface with the IoT device web interface. This is so if they want to config the WIFI username and passwords or if they want to manually upgrade or downgrade the application version running in their device. This is done by the following.

WebServer server(80);

i. RabbitMQ

RabbitMQ nodes bind to ports (open server TCP sockets) to accept client and CLI tool connections. Some of the available ports you can bind are:
- 5672, 5671: used by AMQP 0–9–1 and AMQP 1.0 clients without and with TLS
- 15672: HTTP API clients, management UI and rabbitmqadmin (only if the management plugin is enabled)
- 1883, 8883: MQTT clients without and with TLS, if the MQTT plugin is enabled
- 15675: MQTT-over-WebSockets clients (only if the Web MQTT plugin is enabled)
- 15692: Prometheus metrics (only if the Prometheus plugin is enabled)

rabbitmq:
build: rabbitmq/
image: mqtt-rabbitmq
container_name: "mqtt"
ports:
- "15672:15672"
- "5672:5672"
- "1883:1883"

ii. InfluxDB

--

--

Rodney Osodo

Enthusiastic Quantum computing engineer with a clear understanding of Quantum computing and Machine learning and training in Mechatronics engineering.