In my app, I use a single code base that can run in multiple ways (triggered by env vars). You can imagine having a single repo that knows how to either run in API mode or worker mode, or even wanting to scale different classes of queue workers independently.

Is there any kind of tooling set up to be able to use a common build between different app services like this?

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.

1 answer

The App Platform will reuse builds between components when possible. Sharing builds between components is contingent on the builds having the same git source, build-commands, build-time environment variables and other configuration which differentiate one-build from another.

In practice, the most common difference between builds is environment variables. By default variables are configured for both build and runtime. Using the API or doctl you can edit variables scope directly in the App spec to have only apply at runtime. Variables with RUN_TIME scope can differ between components without impacting build reuse.

Submit an Answer