-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE_REQUEST] Allow to mount dist/ directory as volume #1570
Comments
I believe this should be possible by modifying the build command, to include the Lines 24 to 25 in eea193a
- RUN yarn build --mode production
+ RUN yarn build --mode production --no-clean I'll test that out this evening, and see if I can get a PR for you :) |
Hi @Lissy93 , thank you for the quick reply and taking this on. Thank https://github.com/Lissy93/dashy/blob/master/package.json#L14 and that https://github.com/Lissy93/dashy/blob/master/package.json#L10 Even if you change the dockerfile the build call above will (try to) remove the directory at runtime? |
Basically I tried this change locally (adding a couple of yarn scripts in the package.json): And if they are there, in k8s I can override the command and call the no-clean option:
I am not doing the PR because I understand the change is horrible, and I don't expect to pollute the repo with every single user usecase ^^ But maybe the example can help finding a cleaner solution to allow the no-clean option? |
Ah yes, you're right, it should go in the run stage, and not the build stage - so the package.json under |
This comment was marked as off-topic.
This comment was marked as off-topic.
Yeah, it should. I'll do it when I get a moment, it's not merged yet, so it's chill |
I will close this issue since I have a temporary workaround for now. |
Is your feature request related to a problem? If so, please describe.
Context: Dashy running in docker inside k8s
Currently on a new boot the application takes some time (depending on the CPU available to the pod) to generate the content of the
dist/
directory. This process in my case is pretty slow (running on my raspberry PI with low k8s limits).This per-se would not be a problem if I could cache it, which I was planning to do.
However, when you try to mount a volume in
/dist
the boot fails because for some reasons the app tries todelete
the directory before generating it. This is not possible for mounted volumes.Describe the solution you'd like
I know close to nothing about how vue works but I found a way to hack it temporarily (in my case). By adding to the
build
script the flag--no-clean
I am able to start up the pod correctly and make it generate the files.I do this by mounting a "modified" version of the package.json inside the container at runtime, but I expect I could achieve the same by sed-ding the line at startup via init-container.
I don't understand the reason to delete the dir itself, when would be enough to clean the content of it, however I expect this to be an intrinsic behaviour of the framework.
It would be good to have a way to allow the app to "not" try to delete the directory at startup and allow the cache directory to be mounted as volume from outside for systems with small resourses to spare in asset generation.
Priority
Medium (Would be very useful)
Is this something you would be keen to implement
None
The text was updated successfully, but these errors were encountered: