This commit is contained in:
2026-09-11 14:05:09 +03:00
parent d4dd7be4ef
commit 3079c4edc2
3 changed files with 87 additions and 13 deletions

View File

@@ -15,6 +15,17 @@ COPY help_processor.py /app/help_processor.py
COPY help_codes.py /app/help_codes.py
COPY Bairaci.png /app/Bairaci.png
# Git SHA after COPY so pip layer stays cached.
# Coolify: Advanced → Include Source Commit in Build = ON
# (или Build ARG GIT_SHA). Иначе се ползва hash на копираните файлове.
ARG SOURCE_COMMIT=
ARG GIT_SHA=
RUN GIT_SHA="$GIT_SHA" SOURCE_COMMIT="$SOURCE_COMMIT" python -c 'import hashlib,os,pathlib,sys; sha=(os.environ.get("GIT_SHA") or os.environ.get("SOURCE_COMMIT") or "").strip(); h=hashlib.sha1(); \
[h.update(p.as_posix().encode()+p.read_bytes()) for p in sorted(pathlib.Path("/app").rglob("*")) if p.is_file() and "/__pycache__/" not in p.as_posix() and p.name!="BUILD_ID"]; \
pathlib.Path("/app/BUILD_ID").write_text(sha or h.hexdigest()[:12], encoding="utf-8"); \
print("BUILD_ID", pathlib.Path("/app/BUILD_ID").read_text(), file=sys.stderr)'
ENV APP_GIT_SHA=${GIT_SHA}
ENV OUTPUT_DIR=/mnt/mssql/share/RIP/RIP_Help_Source/Output
ENV HOME_IMAGE=/app/Bairaci.png
ENV HELP_REMOTE_ROOT=/mnt/mssql/share/RIP/RIP_Help_Source/Output