From c18b74fef6926f717af20575d73934ceb20a0f6a Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 27 Dec 2016 16:02:53 +0000 Subject: [PATCH] Dockerisation. --- Dockerfile | 3 +++ project.clj | 5 ++++- src/mw_ui/routes/save.clj | 8 ++++---- 3 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..afcd747 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM tomcat:alpine +COPY target/microworld.war $CATALINA_HOME/webapps/ + diff --git a/project.clj b/project.clj index e280238..a3a3dfe 100644 --- a/project.clj +++ b/project.clj @@ -23,7 +23,10 @@ :repl-options {:init-ns mw-ui.repl} :plugins [[lein-ring "0.8.11"] [lein-environ "0.5.0"] - [lein-marginalia "0.7.1"]] + [lein-marginalia "0.7.1"] + [io.sarnowski/lein-docker "1.1.0"]] + :docker {:image-name "simonbrooke/microworld" + :dockerfile "Dockerfile"} :ring {:handler mw-ui.handler/app :init mw-ui.handler/init :destroy mw-ui.handler/destroy diff --git a/src/mw_ui/routes/save.clj b/src/mw_ui/routes/save.clj index d75417a..407495b 100644 --- a/src/mw_ui/routes/save.clj +++ b/src/mw_ui/routes/save.clj @@ -3,6 +3,7 @@ mw-ui.routes.save (:require [clojure.pprint :as pretty :only [pprint]] [noir.session :as session] + [noir.response :as response])) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; @@ -33,8 +34,7 @@ an attempt to prevent the browser trying to do anything clever with it. Note that it is saved as a raw Clojure data structure, not as XML or any proprietary format." - (response/header - (response/response - (with-out-str (pretty/pprint (session/get :world)))) - "Content-Type" "application/journeyman-mwm; charset=utf-8")) + (response/content-type + "application/journeyman-mwm; charset=utf-8" + (with-out-str (pretty/pprint (session/get :world)))))