We have a nest backend that we host on app platform, the app is using puppeteer cluster that we want to offload from the main backend to a microservice based node server, for this workload app platform workers just look like the perfect choice but the documentation mentions this: Job and worker components can only send outbound requests to other service components and the internet but cannot receive requests. You cannot customize ports for these types of components.
I am not sure if that means workers cannot accept incoming connection? we wanted to use it as a socket connection from our main application, can anyone confirm that we can’t use it for the said purpose?
I would appreciate if someone can propose us a better solution? we don’t want to expose the service publicly
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.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Hi Usman,
You’re correct in your understanding. In DigitalOcean’s App Platform, worker components are designed to perform background tasks and can only initiate outbound requests; they cannot accept incoming connections or listen on a specific port.
This means you wouldn’t be able to use an App Platform worker for socket connections as you described.
What you could do instead is:
App Platform Service Component: Another option is to use a service component on App Platform instead of a worker. Service components can accept incoming HTTP requests, and you can secure them by implementing access control within your application.
Use a Private Droplet: One approach is to deploy your microservice on a DigitalOcean Droplet instead of an App Platform worker. That way you will have more control over the exact configuration that you need as with Droplets you have root access to the server itself.
Use a Kubernetes Cluster: If you’re looking for scalability and isolation, you could consider deploying the microservice in a Kubernetes cluster using the DigitalOcean managed Kubernetes service. This way, you can configure internal services within the cluster that your main application can access, without exposing them publicly.
I hope this helps! Let me know if you have any other questions.
- Bobby