You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running starting the docker image, manage.py collectstatic copies the project_static files to a dedicated static volume - presumably to allow nginx to serve them directly. In copying the static files, the file modification date reflects the date the container is started - i.e. the date and time when collectstatic is run.
If you subsequently update the image to a newer version, but one that was built before the date collectstatic first copied the files, collectstatic does not update the files to the latest version - this is because it does a simple date comparison and leaves the newest in place.
This can lead to a mismatch between the installed version of JS and CSS files and the templates that use them as I've experienced with the Javascript based filter and documented in netbox-community/netbox#5647
Expected Behavior
In the simplest sense, I expect all relevant static content to be updated when the container is updated. If there is no reason to retain the contents of the static volume between versions or runs of the netbox container, it should be deleted and collectstatic re-run (as it is every time the container starts anyway) to replace the static content with that shipped with the version of Netbox being run.
I was able to resolve this by deleting the content of the static directory (or deleting the volume and re-creating it) and then restarting the container or re-running manage.py collectstatic, but ideally I should not have had to do this.
Is there any reason to retain the static volume with the changes to remove nginx from the request chain?
The text was updated successfully, but these errors were encountered:
In the upcoming release 0.28.0 we have removed the need the extra nginx container, From this version on the static files and the python application are both hosted in nginx-unit.
Because of this change we can collect the static files at container build time. So there can't be a mismatch between the file versions and the application version.
Current Behavior
When running starting the docker image, manage.py collectstatic copies the project_static files to a dedicated static volume - presumably to allow nginx to serve them directly. In copying the static files, the file modification date reflects the date the container is started - i.e. the date and time when collectstatic is run.
If you subsequently update the image to a newer version, but one that was built before the date collectstatic first copied the files, collectstatic does not update the files to the latest version - this is because it does a simple date comparison and leaves the newest in place.
This can lead to a mismatch between the installed version of JS and CSS files and the templates that use them as I've experienced with the Javascript based filter and documented in netbox-community/netbox#5647
Expected Behavior
In the simplest sense, I expect all relevant static content to be updated when the container is updated. If there is no reason to retain the contents of the static volume between versions or runs of the netbox container, it should be deleted and collectstatic re-run (as it is every time the container starts anyway) to replace the static content with that shipped with the version of Netbox being run.
I was able to resolve this by deleting the content of the static directory (or deleting the volume and re-creating it) and then restarting the container or re-running manage.py collectstatic, but ideally I should not have had to do this.
Is there any reason to retain the static volume with the changes to remove nginx from the request chain?
The text was updated successfully, but these errors were encountered: