Vue with Docker; initialize | vue with docker
Let’sinitializeaVueprojectfromadockercontainer;buildtheVueprojectwithamulti-stageDockerfile;andfinishwithhowtodevelopindebugmodewithdocker-compose!Allthatisrequiredisthatyouhavedockeranddocker-composeinstalledlocally.Runthefollowingcommandwhilereplacingmyprojectwithyourprojectname:mkdirmyproject&&cd"$_"&&dockerrun--rm-v"${PWD}:/$(basename`pwd`)"-w"/$(basename`pwd`)"-itnode:11.1-alpinesh-c"yarnglobaladd@vue/cli[1]&&vuecreate."
Let’s initialize a Vue project from a docker container; build the Vue project with a multi-stage Dockerfile; and finish with how to develop in debug mode with docker-compose!
All that is required is that you have docker and docker-compose installed locally.
Run the following command while replacing myproject with your project name:
mkdir myproject && cd "$_" && docker run --rm -v "${PWD}:/$(basename `pwd`)" -w "/$(basename `pwd`)" -it node:11.1-alpine sh -c "yarn global add @vue/cli[1] && vue create ."