Understand the available Dockerfile variants
mainThe project provides three different Dockerfile approaches depending on your environment needs:
- Standard (
Dockerfile): Optimized for development. It installsuv, installs project dependencies and the project itself separately to maximize build cache efficiency, adds environment executables to thePATH, and runs the web application in development mode. - Multistage (
multistage.Dockerfile): Optimized for production. It uses multistage builds to reduce the final image size and runs the application in production mode. - Standalone (
standalone.Dockerfile): Optimized for production with controlled runtimes. It extends the multistage approach but uses a managed Python interpreter instead of the system interpreter provided by the base image.
To build the multistage production image:
docker build . --file multistage.Dockerfile