mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Dockerfile/Core: Prevent module update during container runtime (#5205)
* fix(env): Prevent module update during requirements processing - Add environment variable SKIP_REQUIREMENTS_UPDATE check - Ensure update is skipped if SKIP_REQUIREMENTS_UPDATE is set to true * squash! fix(env): Prevent module update during requirements processing - Add environment variable SKIP_REQUIREMENTS_UPDATE check - Ensure update is skipped if SKIP_REQUIREMENTS_UPDATE is set to true
This commit is contained in:
@@ -94,4 +94,5 @@ RUN if [ "$TARGETARCH" = "amd64" ]; then \
|
|||||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
|
||||||
CMD curl -f http://localhost:${PORT:-80} || exit 1
|
CMD curl -f http://localhost:${PORT:-80} || exit 1
|
||||||
|
|
||||||
|
ENV SKIP_REQUIREMENTS_UPDATE=true
|
||||||
ENTRYPOINT [ "python", "WebHost.py" ]
|
ENTRYPOINT [ "python", "WebHost.py" ]
|
||||||
|
@@ -16,7 +16,11 @@ elif sys.version_info < (3, 10, 1):
|
|||||||
raise RuntimeError(f"Incompatible Python Version found: {sys.version_info}. 3.10.1+ is supported.")
|
raise RuntimeError(f"Incompatible Python Version found: {sys.version_info}. 3.10.1+ is supported.")
|
||||||
|
|
||||||
# don't run update if environment is frozen/compiled or if not the parent process (skip in subprocess)
|
# don't run update if environment is frozen/compiled or if not the parent process (skip in subprocess)
|
||||||
_skip_update = bool(getattr(sys, "frozen", False) or multiprocessing.parent_process())
|
_skip_update = bool(
|
||||||
|
getattr(sys, "frozen", False) or
|
||||||
|
multiprocessing.parent_process() or
|
||||||
|
os.environ.get("SKIP_REQUIREMENTS_UPDATE", "").lower() in ("1", "true", "yes")
|
||||||
|
)
|
||||||
update_ran = _skip_update
|
update_ran = _skip_update
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user