Hello, I’m working on writing a YAML App Spec file for a Node api application. I haven’t come across any examples that show how to handle the scenario of deploying multiple environments, such as a test, staging, and production environment. Is there a common best practice way of doing this? Should I just have three entries under “services” in the spec file that use the same repo or image but use different branches or tags? If I did, is it common to “namespace” the service names with the environment, such as “my-app-prod-”, “my-app-staging”, etc?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Yes, your understanding is correct. It’s common to “namespace” your service names with the environment such as “my-app-prod”, “my-app-staging”, etc. This helps to identify and manage different versions of your application. You can indeed have multiple entries under “services” in your spec file using the same repo or image but with different branches or tags. These entries correspond to your different environments.
Please remember to set the appropriate environment variables and resource allocations for each environment as they may require different settings.
However, keep in mind, orchestration and automation of this process can also be achieved through CI/CD pipelines, making it easier to manage and control these environments.
For more information, check out the DigitalOcean Docs on App Platform:
https://docs.digitalocean.com/products/app-platform
Hope that this helps!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.