Question

How to duplicate an instance in app platform + how to make a template + what is best practice for having multiple envs

Hi all,

I have a Django app deployed to the App Platform. Currently, I have only one instance for the staging app. However, I want to make another instance for deployment but I don’t want to redo all the headaches of deploying a Django app again. So, duplicating an app looks great to me.

So my questions are: 1- Is it a good practice to do multiple environments within the same app? or production should be in a different app? 2- How to duplicate the app. 3- How to make an app template so I can easily deploy copies of my app in the future.


Submit an answer


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!

Sign In or Sign Up to Answer

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.

Bobby Iliev
Site Moderator
Site Moderator badge
March 22, 2023

Hi there,

As an alternative to configuring your app in the DigitalOcean control panel, you can define an app specification using YAML.

You can follow the steps on how to do that here:

https://docs.digitalocean.com/products/app-platform/reference/app-spec/

What you could do is to have separate apps for each of your environments, and for example specify a different branch that should be deployed. That way for example, you could have your production app deployed from your main branch and your development environment deployed from another branch.

You can use the DigitalOcean API or doctl, the DigitalOcean command-line tool to deploy your app.

If an app spec is present in the source repo at /.do/app.yaml, the configuration values inside will be used.

An alternative option is to use the DigitalOcean Deploy button but this is just for the initial deployment:

https://docs.digitalocean.com/products/app-platform/how-to/add-deploy-do-button/

Regarding your existing app, you can export the YAML file by following these steps:

  • Go to your App
  • Click on settings
  • Find the ‘App Spec’ section
  • Click the edit button and copy the YAML from there

Hope that this helps!

Best,

Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

card icon
Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Sign up
card icon
Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We’d like to help.

Learn more
card icon
Become a contributor

You get paid; we donate to tech nonprofits.

Learn more
Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine or ten thousand.

Learn more ->
DigitalOcean Cloud Control Panel