
įinally, let’s run our Vue.js app in a Docker container: docker run -it -p 8080:8080 - rm -name dockerize-vuejs-app-1 vuejs-cookbook/dockerize-vuejs-app Now let’s build the Docker image of our Vue.js app: docker build -t vuejs-cookbook/dockerize-vuejs-app. It may seem redundant to first copy package.json and package-lock.json and then all project files and folders in two separate steps but there is actually a very good reason for that (spoiler: it allows us to take advantage of cached Docker layers).

# build app for production with minification # copy project files and folders to the current working directory (i.e. # copy both 'package.json' and 'package-lock.json' (if available) # make the 'app' folder the current working directory # install simple http server for serving static content Let’s start by creating a Dockerfile in the root folder of our project: FROM node:lts-alpine So you built your first Vue.js app using the amazing Vue.js webpack template and now you really want to show off with your colleagues by demonstrating that you can also run it in a Docker container.
