mozilla / webcompat-dashboard

Web Compatibility Knowledge Base Next Generation Dashboard
Mozilla Public License 2.0
0 stars 2 forks source link

Drop ViteExpress in production #14

Closed denschub closed 5 months ago

denschub commented 5 months ago

Currently, the backend also servers the frontend resources. That was meant as a workaround: the original plan was to separate frontend and backend entirely, and have the frontend hosted on GitHub Pages. This didn't work out, so adding the ViteExpress server was a quick solution to get frontend assets served.

The problem: The ViteExpress impl is very memory intensive. In the range of 100-150MB, even in production, which is bonkers. We should get rid of it, and we have two options:

  1. Adjust the whole build pipeline to build two containers: one for the backend, and one for the frontend - just a small container using nginx to serve static files
  2. Use the express.static middleware to serve static files. This one is easy - we already build the statics into dist/, we just have to convince express to serve it.