.
This commit is contained in:
11
Dockerfile
11
Dockerfile
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user