Optimized for: Gemini / ChatGPT / Claude
Advanced AI Prompt for Python Poetry Multi-Stage Optimization
Use this engineered prompt to drastically optimize your workflow and output.
Required Variables
- ✦
[PYTHON_VERSION] - ✦
[PYPROJECT_PATH] - ✦
[VIRTUAL_ENV_DIR] - ✦
[APP_PORT]
python-poetry-multi-stage-optimization.txt
You are a Cloud Architect. Design a multi-stage Python Dockerfile using [PYTHON_VERSION] and Poetry. Stage 1 must configure Poetry to not create a virtual environment or use a specific [VIRTUAL_ENV_DIR], install only production dependencies from [PYPROJECT_PATH], and use a build-base for C-extensions. Stage 2 must copy only the installed site-packages or virtual env to a slim-buster image. Implement high-performance settings: bytecode suppression (.pyc), buffer disabling, and a dedicated worker user. Expose [APP_PORT] and define a robust CMD.
Example Output
"The output will be a streamlined Python Dockerfile that avoids installing Poetry in the final image, significantly decreasing the attack surface and boot time."