App Platform is a Platform-as-a-Service (PaaS) offering that allows developers to publish code directly to DigitalOcean servers without worrying about the underlying infrastructure.
App Platform supports two ways to build an image for your app: Cloud Native Buildpacks and Dockerfiles.
When you give App Platform access to your code, it defaults to using a Dockerfile if one is present in the root of the directory or specified in the app spec. Otherwise, App Platform checks your code to determine what language or framework it uses. If it supports the language or framework, it chooses an appropriate resource type and uses the proper buildpack to build the app and deploy a container.
heroku-buildpack-python is utilized as the buildpack for detecting and building your Python applications.
App Platform looks for any of the following to detect a Python application:
requirements.txt
Pipfile
setup.py
App Platform uses version 253
of the Heroku Python Buildpack. If no version is specified in your app, App Platform defaults to using version 3.12.4
.
App Platform offers the v4, v3, and v2 of the Python buildpack. To start using Python v4 or v3, we recommend upgrading your stack to Ubuntu-22 before upgrading to newer Python buildpack versions. To see specific runtimes that are available for these versions, please look at our release notes.
The buildpack supports the following Python runtime versions:
You can configure the python version used at runtime by specifying a runtime.txt
file at the root of your source code:
python-3.10.4
requirements.txt
, Pipfile
, and setup.py
must be located in the root directory of the repo.gunicorn --worker-tmp-dir /dev/shm project.wsgi
, where project
is the name of your project.