Trying to expose a TCP port for a node-red flow for some colleagues. This should be dead simple. The port I’m trying to open is 3333. Port 80 seems to auto-map to the typical http port 1800 and I can access the standard web editor via port 80. I tried this internal_ports you see at the bottom, but that isn’t working:
alerts:
- rule: DEPLOYMENT_FAILED
- rule: DOMAIN_FAILED
features:
- buildpack-stack=ubuntu-22
ingress:
rules:
- component:
name: nodered-node-red
match:
path:
prefix: /
name: scalesim
region: nyc
services:
- http_port: 8080
image:
registry: nodered
registry_type: DOCKER_HUB
repository: node-red
tag: latest
instance_count: 1
instance_size_slug: basic-xxs
internal_ports:
- 3333
name: nodered-node-red
Can someone advise how I might change this App Spec so that I can test the 3333 TCP port listener in my flow?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hey Will,
I see you’re looking to expose 3333 as TCP port for your Node-RED flow on the DigitalOcean App Platform. Based on the current capabilities of the App Platform, there are a few key points to consider:
The
http_port
field in your app specification determines the internal port that your service’s run command listens on. This is typically geared towards HTTP traffic. If you don’t set aPORT
environment variable, the App Platform automatically uses the value ofhttp_port
.The
internal_ports
array you mentioned is intended for internal traffic within your application. These ports are used for communication between services within your app and are not exposed externally. Ports defined ininternal_ports
field can accommodate any TCP-based traffic.For routing external HTTP traffic to your service, you’ll use the
ingress
rules in your app spec. This is where you define how HTTP requests are directed to your service components. However, this is specifically for HTTP/HTTPS traffic and not for arbitrary TCP ports.Given these constraints, if your application requires a direct exposure of a TCP connection on port 3333 that can’t be adapted to HTTP/WebSockets, you might find the App Platform limiting for this specific use case. In this scenario, a DigitalOcean Droplet could be a better fit. Droplets provide more flexibility in terms of network configurations, allowing direct management of TCP ports.
Hope that this helps!
Best,
Bobby