Update Dockerfile: Python 3.12, reduce layers, add prestart.sh#59
Open
snowball77 wants to merge 2 commits into
Open
Update Dockerfile: Python 3.12, reduce layers, add prestart.sh#59snowball77 wants to merge 2 commits into
snowball77 wants to merge 2 commits into
Conversation
- Update base image from python3.9 (EOL) to python3.12 - Combine Poetry setup into a single RUN layer - Combine mkdir calls into one - Combine COPY statements where possible - Add docker/prestart.sh to initialize DB on container start (runs 'flask db upgrade' with fallback to 'flask create_db') Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
python3.12 is incompatible with the pinned dependency versions (python-dateutil requires six, distutils removed). python3.11 is supported until October 2027 and works with the current poetry.lock. Upgrading to python3.12 would require updating the dependencies. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Author
|
Kurze Erklärung zum Downgrade von 3.12 auf 3.11: Beim Testen hat sich herausgestellt, dass die aktuell in
Python 3.11 ist bis Oktober 2027 supported und funktioniert mit dem aktuellen |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Python 3.9 → 3.12
Python 3.9 reached end-of-life in October 2025. This updates the base image to
python3.12, the latest available tag fortiangolo/uwsgi-nginx-flask.Reduced layer count
RUNlayermkdircalls into oneCOPYstatements where possibleAdd
docker/prestart.shThe base image (
tiangolo/uwsgi-nginx-flask) automatically executes/app/prestart.shbefore starting the server. This is the proper place for DB initialization, rather than running code at module import time (as proposed in #58).Tries
flask db upgradefirst (for setups using Flask-Migrate), falls back toflask create_dbif no migrations are present.