diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0dfae96 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM tomcat:alpine +COPY target/smeagol-*-standalone.war $CATALINA_HOME/webapps/smeagol.war + diff --git a/README.md b/README.md index c809a8a..ce62681 100644 --- a/README.md +++ b/README.md @@ -67,3 +67,25 @@ Alternatively, if you want to deploy to a servlet container (which I would stron (a command which I'm sure Smeagol would entirely appreciate) and deploy the resulting war file. +## Experimental Docker image + +You can now run Smeagol as a [Docker](http://www.docker.com) image. To run my Docker image, use + + docker run simonbrooke/smeagol + +Smeagol will run, obviously, on the IP address of your Docker image, on port 8080. To find the IP address, start the image using the command above and then use + + docker inspect --format '{{ .NetworkSettings.IPAddress }}' $(docker ps -q) + +Suppose this prints '10.10.10.10', then the URL to browse to will be http://10.10.10.10:8080/smeagol/ + +This image is _experimental_, but it does seem to work fairly well. What it does **not** yet do, however, is push the git repository to a remote location, so when you tear the Docker image down your edits will be lost. My next objective for this image is for it to have a cammand line parameter being the git address of a repository from which it can initialise the Wiki content, and to which it will periodically push local changes to the Wiki content. + +To build your own Docker image, run: + + lein clean + lein bower install + lein ring uberwar + lein docker build + +This will build a new Docker image locally; you can, obviously, push it to your own Docker repository if you wish. diff --git a/project.clj b/project.clj index a6c9d31..5b3236a 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject smeagol "0.5.1-SNAPSHOT" +(defproject smeagol "0.5.2-SNAPSHOT" :description "A simple Git-backed Wiki inspired by Gollum" :url "https://github.com/simon-brooke/smeagol" :dependencies [[org.clojure/clojure "1.7.0"] @@ -16,7 +16,7 @@ com.sun.jmx/jmxri]] [com.taoensso/timbre "4.7.4" :exclusions [org.clojure/tools.reader]] [com.taoensso/tower "3.0.2" :exclusions [com.taoensso/encore]] - [markdown-clj "0.9.89" :exclusions [com.keminglabs/cljx]] + [markdown-clj "0.9.91" :exclusions [com.keminglabs/cljx]] [crypto-password "0.2.0"] [clj-jgit "0.8.9"] [environ "1.1.0"] @@ -30,8 +30,11 @@ [lein-environ "1.0.0"] [lein-bower "0.5.1"] [lein-ancient "0.5.5" :exclusions [org.clojure/clojure org.clojure/data.xml]] - [lein-marginalia "0.7.1" :exclusions [org.clojure/clojure]]] + [lein-marginalia "0.7.1" :exclusions [org.clojure/clojure]] + [io.sarnowski/lein-docker "1.1.0"]] :bower-dependencies [[simplemde "1.11.2"]] + :docker {:image-name "simonbrooke/smeagol" + :dockerfile "Dockerfile"} :ring {:handler smeagol.handler/app :init smeagol.handler/init :destroy smeagol.handler/destroy}