[Vuejs]-Running Vue.js App on a different port with docker

5👍

Your application server runs by default on 8080

https://www.npmjs.com/package/http-server

Use flag -p 3838 to serve on that port.
Docker is doing its job correctly, adjust in your CMD

CMD [ "http-server", "-p 3838", "dist" ]

2👍

You can try just use the port 8080 of the continer and map it to port 3838 of your host.

#Dockerfile: delete the line -> Expose 3838
#Command line : $ sudo docker run -it -p 3838:8080 vuetest

This is an option not to add more lines to the Dockerfile.
Bye

Leave a comment