diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..ccd148f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +node_modules +.idea +npm-debug.log diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1f27a38 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM node:16-alpine + +WORKDIR /app + +COPY package*.json ./ + +RUN npm install + +COPY . . + +EXPOSE 8080 + +CMD ["npm", "run", "serve"] diff --git a/README.md b/README.md index 76dbe87..a94321b 100644 --- a/README.md +++ b/README.md @@ -82,4 +82,21 @@ rules. ### Validation Parameters * validation: string representation of the validation rules * validationData: a reference to a data model to validate against. Useful if you are using rules that reference other properties -* validationMessages: A custom map of validation messages to use if defaults are not wanted (ex: translations). See validatorjs repository for the formatting of this parameter. \ No newline at end of file +* validationMessages: A custom map of validation messages to use if defaults are not wanted (ex: translations). See validatorjs repository for the formatting of this parameter. + + +## Running with Docker (Development) +To test VueFormElements using Docker, you can build this image locally and test it out. By running these commands from your terminal. +```shell +docker build vfe: . +docker run -p 8080:8080 -d vfe: +``` +OR + +You can use **docker compose** to spin up your container easily by running these commands +```shell +docker compose build +docker compose up +``` +Once you are done, you can `control + c` to terminate the process +* Go to your browser and go to http://localhost:8080 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..a0bdf77 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,6 @@ +services: + vfe: + build: + dockerfile: Dockerfile + ports: + - 8080:8080