Hi DO, I’m building a Node.js app which requires a Docker internal service, it needs to be able to access the Docker internal service (via env vars). Currently, I couldn’t find documentation anywhere talk about this. I couldn’t configure workers in deploy.template.yaml, either. My configuration: https://github.com/phuctm97/img-node/blob/master/.do/deploy.template.yaml
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.
Hello, quickly looking at the linked repository it seems the API is trying to talk to the puppeteer worker via websockets. In App Platform workers are not exposed via HTTP. For this type of interaction you should use “internal services” rather than a worker. See internal_ports in app spec reference. Here is an example repo utilizing the concept (under the
/multi
route).So in your case, I think the spec should look something like:
That should result in the
api
service exposed publicly, and thechrome
service exposed internally on port3000
. Provided thatbrowserless/chrome
respects thePORT
env parameter (quickly looking into the code on GitHub it looks like it should), that should make the puppeteer websocket service available to call from theapi
service.Hope this helps!