Dockerfile: stamp a unique x-coop-build meta into index.html every build — forces the service worker precache to update so stale clients self-heal on deploy

This commit is contained in:
Nathan Schneider committed 2026-10-20 13:44:37 -06:00
1 parent 3b706eed74
commit 4b534fcaa2
1 file changed
+3 -2
+3 -2
View File
@@ -44,8 +44,9 @@ RUN python3 /app/code/patch_ui_strings.py
# Inject branding into built HTML (dist) before image is packaged # Inject branding into built HTML (dist) before image is packaged
# rebuild marker 20261019-$(date +%s) # rebuild marker 20261019-$(date +%s)
RUN sed -i 's|<title>LibreChat</title>|<title>Inference Co‑op</title>|' /app/code/librechat/client/dist/index.html && \ RUN sed -i 's|<title>LibreChat</title>|<title>Inference Co‑op</title>|' /app/code/librechat/client/dist/index.html && \
sed -i '/<title>Inference Co‑op<\/title>/a <link rel="stylesheet" href="assets/custom.css">' /app/code/librechat/client/dist/index.html && \ sed -i '/<title>Inference Co‑op<\\/title>/a <link rel="stylesheet" href="assets/custom.css">' /app/code/librechat/client/dist/index.html && \
sed -i '/<link rel="stylesheet" href="assets\/custom.css">/a <script src="assets/custom2.js"></script>' /app/code/librechat/client/dist/index.html && \ sed -i '/<link rel="stylesheet" href="assets\\/custom.css">/a <script src="assets/custom2.js"></script>' /app/code/librechat/client/dist/index.html && \
sed -i "s|</title>|</title>\\n <meta name=\"x-coop-build\" content=\"$(date +%s)\">|" /app/code/librechat/client/dist/index.html && \
sed -i 's|assets/logo.svg|assets/logo.svg?v=3|g' /app/code/librechat/client/dist/assets/index.*.js && \ sed -i 's|assets/logo.svg|assets/logo.svg?v=3|g' /app/code/librechat/client/dist/assets/index.*.js && \
rm -f /app/code/librechat/client/dist/assets/index.*.js.gz /app/code/librechat/client/dist/assets/index.*.js.br rm -f /app/code/librechat/client/dist/assets/index.*.js.gz /app/code/librechat/client/dist/assets/index.*.js.br