diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9594b06 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM ubuntu:bionic +RUN apt-get update -y +# Timezone configuration is required to avoid tzdata interuption while installing packages. +ENV TZ=Asia/Jakarta +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +RUN apt-get -y install software-properties-common build-essential python-dev python-pip git unzip +RUN add-apt-repository ppa:freecad-maintainers/freecad-daily +RUN apt-get update -y +RUN apt install -y freecad +COPY . . +RUN pip install -r requirements.txt +CMD [ "./kb_builder.py" ] diff --git a/README.md b/README.md index 6fa86d0..be3cd03 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ kb_builder **NOTE: The CAD engine (KAD) which powers the current [builder.swillkb.com](http://builder.swillkb.com) builder has been open sourced and is available here [github.com/swill/kad](https://github.com/swill/kad). Enjoy...** -`kb_builder` is the original engine that ran [builder.swillkb.com](http://builder.swillkb.com). That service has been completely rewritten in Golang, but this project is still a useful environment to hack on. +`kb_builder` is the original engine that ran [builder.swillkb.com](http://builder.swillkb.com). That service has been completely rewritten in Golang, but this project is still a useful environment to hack on. This tool uses the JSON layout generated by the [Keyboard Layout Editor](http://www.keyboard-layout-editor.com/). There are a lot of hidden features that you can do when building plates. Check the `?` next to the `Plate Layout` text field in the UI for more details. @@ -90,14 +90,14 @@ $ cd ~/ $ sudo freecad # 'sudo' so it creates the correct '/root/.FreeCAD' directory # note the version number - # download the appropriate version from here: + # download the appropriate version from here: # https://github.com/yorikvanhavre/Draft-dxf-importer # i will assume freecad version v16 and the latest importer (v15) $ wget https://github.com/yorikvanhavre/Draft-dxf-importer/archive/1.38.zip $ unzip 1.38.zip # this will create the 'Draft-dxf-importer-1.38/' directory $ cp Draft-dxf-importer-1.38/* /root/.FreeCAD/ - # Note: we are putting this import into the 'root' users '.FreeCAD' + # Note: we are putting this import into the 'root' users '.FreeCAD' # not your users because we are running with 'sudo' ``` @@ -108,6 +108,12 @@ $ cp Draft-dxf-importer-1.38/* /root/.FreeCAD/ $ cd ~/kb_builder && sudo ./kb_builder.py ``` +### Docker + +``` +$ docker build -t swillkb . +$ docker run -p 8000:80 swillkb +``` ## License