From 76f8d905f0433bcbacb315782347aaa5fca7f662 Mon Sep 17 00:00:00 2001 From: matt Date: Sun, 10 Jan 2021 19:03:13 +0000 Subject: [PATCH] added dockerfile build process for www --- builder/README.md | 7 +++++++ builder/build_www.sh | 19 +++++++++++++++++++ builder/dockerfile.www.build | 9 ++++++--- 3 files changed, 32 insertions(+), 3 deletions(-) create mode 100755 builder/build_www.sh diff --git a/builder/README.md b/builder/README.md index 41af2d8..2f63367 100644 --- a/builder/README.md +++ b/builder/README.md @@ -1,6 +1,13 @@ REQIUREMENTS Docker CE +# Build the www webpack +``` +sudo docker build -t kasmweb/www -f builder/dockerfile.www.build . +sudo docker run -it --rm -v $PWD/builder/www:/build kasmweb/www:latest +``` + + # build the docker image cd /src_code_root sudo docker build -t kasmvncbuilder:18.04 -f builder/dockerfile.build . diff --git a/builder/build_www.sh b/builder/build_www.sh new file mode 100755 index 0000000..a0cd8a1 --- /dev/null +++ b/builder/build_www.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# clear previous build +rm -rf /build/* + +# build webpack +npm run build +# remove node stuff from directory +rm -rf node_modules/ +# copy all to build dir +cp -R ./* /build/ + +# remove unneccesary files +cd /build +rm *.md +rm AUTHORS +rm *.yml +rm vnc.html +rm vnc_lite.html diff --git a/builder/dockerfile.www.build b/builder/dockerfile.www.build index ec2c984..be30b4b 100644 --- a/builder/dockerfile.www.build +++ b/builder/dockerfile.www.build @@ -1,7 +1,10 @@ -FROM node:15-buster +FROM node:12-buster -COPY kasmweb/ /src/ +COPY kasmweb/ /src/www/ +COPY builder/build_www.sh /src/ -WORKDIR /src +WORKDIR /src/www RUN npm install + +ENTRYPOINT [ "/src/build_www.sh" ]