App Platform supports PostgreSQL, MySQL, and Redis Managed Databases. Some repos have an app spec at
.do/app.yaml however that is not used by App Platform at all - it’s mostly a convention to store the app spec at that path so that others can find it easily.
You can add the database from the control panel by browsing to your App -> Components -> Add Database and then select your MySQL database.
Alternatively, you can edit your App Spec directly and use the
doctl CLI tool to apply the changes to your app. Also, in spec you posted,
num_nodes has been deprecated and
instance_size_slug should be a property of the service component like so:
- engine: MYSQL
- environment_slug: python
If you do not have doctl installed, you can follow these instructions.
To create a new app from the spec, run
doctl apps create --spec app.yaml.
If you have an existing app that you want to edit:
- List your apps and find your app’s UUID:
doctl apps list
- Save your app’s spec to a file:
doctl apps spec get APP-UUID > app.yaml
app.yaml in a text editor and add the database.
- Update your app with the new spec:
doctl apps update --spec app.yaml APP-UUID. This will kick off a new deployment.
See the App Specification Reference for more info about app specs.