/vuedockerized

Vue development environment inside Docker

Primary LanguageShellCreative Commons Zero v1.0 UniversalCC0-1.0

vuedockerized

Vue environment based on Docker

Requirements

To have a Docke environment installed and running correctly.

All the files must be on the same directory and, ideally, on PATH.

Tool jq ust be present on PATH

Contents

vueinithere.sh

This script initializes a project based on Vue on the current directory.

It can be executed with an extra parameter: build. It will check for the last version of @vue/cli and will create, and update if already exists, the base image for the normal execution of itself and to create the container of the application based on Vue with the next script.

With a normal execution it checks if this base image exists, otherwise, it will create it. The name of the image will be defined using the name of the current user as the context on local Docker repository.

vuecontainerize.sh

This script creates the production image of the project using the base image created in the previous script. The name of the image will be defined also using the name of the current user as the context on local Docker repository. The version will be taken from file package.json and this image will be tagged as latest too.

It can be executed with an extra parameter. The unique recognized value for this parameter is dev, so the created image will have dev as version value and can be used to build or test the Vue application as we will see on next script.

vuerundockerized.Dockerfile

It is the template used by the previous script to create the base image of the application based on Vue.

vuerundockerized.sh

This script will execute the image associated to prodution environment (tagged as latest) created with the previous script.

It can be executed with an extra parameter, the version of the image that we want to execute, by example dev wich is available if it was created with the previous script, on this case the current directory will be mapped to the appication directory inside the container so it should (must) be the project directory. On this specific case, a session inside the container will be opened to make easy to use vue command.

An example of dev scenario:

$ > vuerundockerized.sh dev /bin/bash
root:hdsv83hdds8fd $ > npm run build
...
# next command will 'connect' the container environment with the host environment so you can access the UI
root:hdsv83hdds8fd $ > vue ui -H 0.0.0.0

©️ License

CC0-1.0 License