Join 1M+ other developers and:
- Get help and share knowledge in Q&A
- Subscribe to topics of interest
- Get courses & tools that help you grow as a developer or small business owner
How do I call a long-running script on DigitalOcean App Platform?
(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?
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.×