npm run watch in docker compose

385 Views Asked by At

Im using Laravel Mix to build assets (css,js) , When i run npm run watch without using docker it work with opening a new browser Tab to watch changes for css and js files.

But when using docker , i run this command docker compose run --rm npm run watch i got this error :

[Browsersync] Couldn't open browser (if you are using BrowserSync in a headless environment, you might want to set the open option to false)

My webpackconfig.mix.js

miw.browsersync({
proxy:'http://localhost:8008',
port:3001,
files:[public/*.css,public/*.js]
})

my docker-compose.yaml

image:node:latest
working_dir:/src
entrypoint:['npm']
ports:
  -3001:3001
command : ["npm","run","dev","prod","watch"]

Is there any recommandations to watch changes in the browser .Thanks

0

There are 0 best solutions below