arielsalminen / vue-design-system

An open source tool for building UI Design Systems with Vue.js
https://vueds.com
MIT License
2.17k stars 225 forks source link

problem running VDS inside a container (OpenShift) #126

Closed gdubya closed 5 years ago

gdubya commented 5 years ago

Hi, We're testing out deploying our own extension of VDS and trying to deploy it into a container, but the npm-run-all command fails:

Launching via npm...
npm info it worked if it ends with ok
npm info using npm@5.6.0
npm info using node@v8.9.4
npm info lifecycle amazeballs-design-system@0.5.0~prestart: amazeballs-design-system@0.5.0
npm info lifecycle amazeballs-design-system@0.5.0~start: amazeballs-design-system@0.5.0

> amazeballs-design-system@0.5.0 start /opt/app-root/src
> npm-run-all --parallel styleguide theo:onchange theo dev

sh: npm-run-all: command not found
npm info lifecycle amazeballs-design-system@0.5.0~start: Failed to exec start script

This is probably an issue with the container setup rather than VDS itself, but I'm not quite sure why it doesn't "just work". Can anyone explain?

arielsalminen commented 5 years ago

@gdubya Maybe the comment here helps: https://github.com/mysticatea/npm-run-all/issues/96

gdubya commented 5 years ago

Actually it was because the OpenShift Docker image was pruning all "dev" dependencies because it was running in "production" mode. See https://github.com/sclorg/s2i-nodejs-container/blob/master/8/s2i/bin/assemble. So setting a DEV_MODE environment variable fixed that issue :+1:

We also had to update the "styleguide" script to remove the "--open" parameter (it's running headless now).

We're still not 100% there yet, but i think the problems are more related to our OpenShift installation rather than VDS, so I'll close this issue. :)

gdubya commented 5 years ago

Just another note, in case anyone comes down this thread in the future: webpack-dev-server only listens on the loopback adapter by default, so you would also need to add "--host 0.0.0.0" and "--disable-host-check " to the "dev" options.

All this said and done, we then realised that we were probably barking up the wrong tree by trying to get the webpack dev server running this way in the first place, and a better solution is to do what is suggested in the console and just serve the generated static files through a normal web server instead!