From 2735448b0254b2edfb9433cc5b674eb9bade75da Mon Sep 17 00:00:00 2001 From: Billiam Date: Wed, 29 May 2019 17:33:20 -0500 Subject: [PATCH] Adding Dockerfile, updating readme --- Dockerfile | 8 ++++++++ README.md | 11 +++++++++++ 2 files changed, 19 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..f9e74f255 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM clojure +RUN mkdir -p /usr/src/app +WORKDIR /usr/src/app +COPY project.clj /usr/src/app +RUN echo '{:user {:plugins [[lein-exec "0.3.7"]]}}' > ~/.lein/profiles.clj +RUN lein deps +COPY . /usr/src/app +CMD ["lein", "exec", "-ep", "(load-file \"src/dactyl_keyboard/dactyl.clj\")"] diff --git a/README.md b/README.md index 859154f54..e25802d9a 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,17 @@ I built a 4x5 version (40% size) for myself. The default has a bit more tenting * Make changes to design, repeat `load-file`, OpenSCAD will watch for changes and rerender. * When done, use OpenSCAD to export STL files +**Generate the design (via Docker)* +* Build the docker container: `docker build -t dactyl .` +* Run +``` +docker run -it --rm \ +-v "$(pwd)/things:/usr/src/app/things" \ +-v "$(pwd)/src:/usr/src/app/src" \ +dactyl lein repl +``` +* Load the file `(load-file "src/dactyl_keyboard/dactyl.clj")` + **Tips** * [Some other ways to evaluate the clojure design file](http://stackoverflow.com/a/28213489) * [Example designing with clojure](http://adereth.github.io/blog/2014/04/09/3d-printing-with-clojure/)