Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docker: ensure the server can see the .hotfile from the new frontend
The `.hotfile` is used by Vite to store some information about Hot-Module Replacement (HMR) and also by the django-vite-plugin to figure out whether Vite is running[1]; this creates a filesystem dependency where 2024-frontend has to write the hotfile and the server has to read it. But now that we git-ignore[2] the hotfile (which is a good idea) the server couldn't see the file anymore. Before: 1. We built the server Docker image with all the files in it; 2. We built the 2024-frontend image based on it; 3. It had a (stale) `.hotfile` included because we tracked it. After the ignore: 1. We built the server Docker images without the hotfile ; 2. We built the 2024-frontend image based on it; 3. The hotfile was not present because 2024-frontend writes it to `../app` but since we only mounted `2024-frontend` into `/app/2024-frontend` the parent folder is not shared: no hotfile, everybody gets sad. Now: 1. We share the whole current folder into `.:/app`, which means the 2024-frontend writes the hotfile up into `../` and the server sees it; 2. Things work as expected. [1]: https://github.com/protibimbok/django-vite-plugin/blob/master/django/src/django_vite_plugin/utils.py#L120-L124 [2]: 0687770
- Loading branch information