ConceptsBuilds & runtimes
Python
What the generated Dockerfile does for a Python project, when you set no build or start command.
With a requirements.txt, pip installs the dependencies.
1 / 3
The picture shows which package manager installs the dependencies.
The defaults
| Step | What Ferry does |
|---|---|
| Base image | The base image is python:<version>-slim. The version comes from .python-version or runtime.txt (python-3.11.4). The default is 3.12. |
Install with requirements.txt | pip install -r requirements.txt |
Install with pyproject.toml | uv when there is a uv.lock. Poetry for Poetry projects. If not, pip install . or the dependencies of the project. |
Install with Pipfile | Pipenv |
| Build | None by default. Your build command runs after the install. |
| Start | python main.py. If that file is not there, python app.py. |
For a full generated file, see the example.
A project that uses psycopg2 or mysqlclient gets the system libraries that these packages compile against.