Prebuild webpage in Docker and load VUE_APP_CESIUM_TOKEN dynamically#465
Prebuild webpage in Docker and load VUE_APP_CESIUM_TOKEN dynamically#465bedaberner wants to merge 2 commits intoArduPilot:masterfrom
Conversation
|
@Williangalvani, could you take a look? I think this improves the deployment quite a bit. |
|
Hi. Will this break the current deployment workflow? With the current system, we can just deploy static files, no docker or backend required. The token is embedded into the build step, and we just rsync the files to the server. |
|
Well yes and no: I would however have to test this and document the procedure. While I don't want to question how you host the Tool, I think deploying a docker Image is a much more modern approach and since there Is a dockerfile in this repository, I assumed that's how it is being done. If this is not the case, It would be very helpful to document the constraints of the deployment of the code, as any contributer needs to keep these constraints in mind. |
This PR is based in my desire to host this app in a low ressource (k8s) environment.
Currently the prebuilt docker uses
npm run devto host the app which triggers a very ressource intense rebuild of the page.My goal was to precompile the app during the docker build process to get around this wasteful process.
To achieve this I had to:
npm run buildduring the docker build process and setnpm startup so it serves the precompiled page.Sorry for not splitting the changes nicely in multiple commits, I thought this would be a very easy fix but had to change more and more things