Im facing an issue with docker-compose, when i try to run vuejs app inside a container. First i build vuejs app using :
docker-compose docker-compose run node npm run build -- --mode=iso
so a folder ‘dist’ is created successfully in the project root, then i try to run server using this command :
docker-compose run e2e npm run serve
as an output of this command :
App running at:
Local: http://localhost:8080/
It seems you are running Vue CLI inside a container.
Access the dev server via http://localhost:<your container’s external mapped port>/
App is served in production mode.
Note this is for preview or E2E testing only.
But when i try to access the page, i got : cannot access this page …
==> node service is dedicated to install all dependencies ==> e2e service is dedicated to run server and when it’s up i will run then e2e tests
Any suggestions ??
CodePudding user response:
Are you trying to access http://localhost:8080
? If so it is mentioned that you need to access the container's mapped external port instead of 8080.
CodePudding user response:
try to serve 0.0.0.0 instead of localhost in the run command of the vue server
That will make it accessible outside the network
Also please share the docker-compose.yml so I can make sure you are exposing the ports correctly