diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..ebe18fa7 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +**/node_modules +**/dist + +# Note that Vue config file is excluded from docker image +vue.config.js \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..5587ac34 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM node:lts-alpine + +RUN npm install -g http-server +COPY ./script/dev.sh / + +WORKDIR /app +COPY package*.json ./ +RUN npm install + +COPY . . +RUN npm run build + +EXPOSE 8080 +CMD [ "http-server", "dist" ] diff --git a/README.md b/README.md index 3ef2aa68..ec1b589e 100644 --- a/README.md +++ b/README.md @@ -32,3 +32,20 @@ npm run test:unit ### Customize configuration See [Configuration Reference](https://cli.vuejs.org/config/). + +## Docker + +Build sigma docker image: +``` +docker build -t primevue/sigma . +``` + +Run sigma docker image (navigate to http://localhost:8080/): +``` +docker run -it -p 8080:8080 --rm --name sigma primevue/sigma +``` + +Run sigma docker image in dev mode: +``` +docker run -it -p 8080:8080 -v $PWD:/app --rm --entrypoint="/dev.sh" --name sigma primevue/sigma +``` diff --git a/script/dev.sh b/script/dev.sh new file mode 100755 index 00000000..0a99a82f --- /dev/null +++ b/script/dev.sh @@ -0,0 +1,2 @@ +#!/bin/ash +npm install && npm run serve \ No newline at end of file