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.
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!
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.
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:
Hope that this helps!
Best,
Bobby