Dockerisation.

This commit is contained in:
simon 2016-12-27 16:02:53 +00:00
parent 4861ee809b
commit c18b74fef6
3 changed files with 11 additions and 5 deletions

3
Dockerfile Normal file
View file

@ -0,0 +1,3 @@
FROM tomcat:alpine
COPY target/microworld.war $CATALINA_HOME/webapps/

View file

@ -23,7 +23,10 @@
:repl-options {:init-ns mw-ui.repl} :repl-options {:init-ns mw-ui.repl}
:plugins [[lein-ring "0.8.11"] :plugins [[lein-ring "0.8.11"]
[lein-environ "0.5.0"] [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 :ring {:handler mw-ui.handler/app
:init mw-ui.handler/init :init mw-ui.handler/init
:destroy mw-ui.handler/destroy :destroy mw-ui.handler/destroy

View file

@ -3,6 +3,7 @@
mw-ui.routes.save mw-ui.routes.save
(:require [clojure.pprint :as pretty :only [pprint]] (:require [clojure.pprint :as pretty :only [pprint]]
[noir.session :as session] [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. 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 Note that it is saved as a raw Clojure data structure, not as XML or
any proprietary format." any proprietary format."
(response/header (response/content-type
(response/response "application/journeyman-mwm; charset=utf-8"
(with-out-str (pretty/pprint (session/get :world)))) (with-out-str (pretty/pprint (session/get :world)))))
"Content-Type" "application/journeyman-mwm; charset=utf-8"))