Question

DigitalOcean App Platform deployments - force build backend component service first and frontend component service after.

Posted January 10, 2021 358 views
Building on DigitalOcean

I have application with two web service components - frontend and backend.

When I push changes to my branch project is automatically redeployed.

How can I force to rebuild backend first and frontend later, because frontend depends on backend.

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.

×
Submit an Answer
1 answer

Hey @banystautvydas ,

Thanks for your question. At the moment, the App Platform does not support guaranteed the ordering of deployments for particular components. I’d recommend designing the frontend to retry connections to the backend.

  • Could you share details or some example how it could be done?

    • It really depends on your setup, but one thing you could do is since you have two web service components, you can alter your deploy command for the frontend service component to wait for the backend to be up by pinging it every N seconds. This can be written in a script.

      Or if the frontend web service, during its server start, could just keep retrying to connect to the backend.