Report this

What is the reason for this report?

How do I call a long-running script on DigitalOcean App Platform?

Posted on March 19, 2021

(I’m using BitBucket so I have to containerize everything, rather an using git repos and Procfiles.)

I’ve made a Docker image that runs a simple HTTP server (“api-server”) and another that has a long-running script (“test-long-script”).

The api container looks like it’s running fine, but how do I get the API server to call the long-script container? To run it from the commandline, I’d use this command:

docker run --rm test-long-script:latest

I want people to be able to make HTTP requests to my api-server web service, like POST /encode-video or GET /do-something-slow?foo=bar, and have the request handler send the POSTdata / query params to the slow script:

docker run --rm test-long-script:latest --foo=bar

I can’t find any documentation on how to use workers, or how to communicate between components, besides “you can use the component name” and something about internal ports. What am I missing?

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.