feat: add cache busting script for JS imports during Docker build
- Introduced a new script to append version query parameters to JS imports, ensuring proper cache busting in production. - Updated Dockerfile to copy and execute the cache busting script during the build process. This enhancement simplifies cache management for JavaScript files in production environments.
This commit is contained in:
parent
9739d5e8e9
commit
5d6271f60c
2 changed files with 51 additions and 0 deletions
|
|
@ -11,6 +11,11 @@ RUN printf '{"version":"%s","buildDate":"%s"}\n' "${VERSION}" "${BUILD_DATE}" >
|
|||
COPY index.html /usr/share/nginx/html/
|
||||
COPY src/ /usr/share/nginx/html/src/
|
||||
|
||||
# Copy and run cache busting script (bash/sed - no external dependencies needed)
|
||||
COPY build-cache-bust.sh /tmp/build-cache-bust.sh
|
||||
RUN chmod +x /tmp/build-cache-bust.sh && \
|
||||
/tmp/build-cache-bust.sh "${VERSION}" /usr/share/nginx/html
|
||||
|
||||
# Copy nginx configuration
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue