I want to use a Docker multi-stage build with Vue.js in the first stage and a Web server in the second.
Starting with the official node
image from Docker Hub, I'm trying to:
- either install the relevant packages (
vue
andvuetify@3.0.4
which I need forv-data-table
; I'm not sure if I should install them globally or not, or if it even makes much difference in this use case) and runnode render.mjs
withrender.mjs
written by me and containingimport
s of necessary stuff from those packages, - or go the Vue CLI way, create a Vue project and see what's possible from there (with the obstacle that it's designed to run interactively – in
npm init vue -y
the-y
is apparently ignored; people filed an issue and came up with some shenanigans in the comments but I'm not sure it's the best solution).
I just want one or a couple of templates (or vnodes, or whatever ends up working) to be rendered in the first stage, copy the results (HTML documents) to the second stage and have no Vue.js running on containers created from the final image (one with the Web server). (I'm fine with some scripts being required on the client side. If I'm not mistaken, that's how Vuetify's data-table can work, load initial data from a totally separate database and provide CRUD functionality.)
What should I put in my Dockerfile
(and possibly in render.mjs
) for the first stage?