summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.dockerignore5
-rw-r--r--Dockerfile43
-rw-r--r--mulkcms-ht.asd9
-rw-r--r--mulkcms-hunchentoot.lisp9
-rw-r--r--package-hunchentoot.lisp2
5 files changed, 66 insertions, 2 deletions
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..93462d9
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,5 @@
+.*
+Dockerfile
+ChangeLog
+COPYING*
+bin
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..159f748
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,43 @@
+###############
+### STAGE 0 ###
+###############
+
+FROM mcreations/sbcl:1.4.1
+
+RUN sbcl --eval "\
+ (progn \
+ (ql:quickload \"deploy\")) \
+ "
+
+COPY . /opt/quicklisp/local-projects/mulkcms
+
+RUN sbcl --eval "\
+ (progn \
+ (ql:quickload \"mulkcms-ht\")) \
+ "
+
+USER root
+RUN mkdir -p /opt/quicklisp/local-projects/mulkcms/bin
+RUN chown lisp /opt/quicklisp/local-projects/mulkcms/bin
+
+RUN sbcl --eval "\
+ (progn \
+ (asdf:make \"mulkcms-ht\")) \
+ "
+
+
+###############
+### STAGE 1 ###
+###############
+
+FROM debian:9-slim
+
+RUN apt-get update && apt-get install -y libssl1.0 && rm -rf /var/lib/apt/lists/* && apt-get clean
+
+
+COPY --from=0 /opt/quicklisp/local-projects/mulkcms/bin /mulkcms/bin
+COPY static-files /mulkcms/static-files
+COPY templates /mulkcms/templates
+
+WORKDIR /mulkcms
+ENTRYPOINT ["/mulkcms/bin/mulkcms-ht"]
diff --git a/mulkcms-ht.asd b/mulkcms-ht.asd
new file mode 100644
index 0000000..b02278a
--- /dev/null
+++ b/mulkcms-ht.asd
@@ -0,0 +1,9 @@
+(asdf:defsystem mulkcms-ht
+ :version "0.0.1"
+ :depends-on (:mulkcms-hunchentoot)
+ :components ()
+
+ :defsystem-depends-on (:deploy)
+ :build-operation "deploy-op"
+ :build-pathname "mulkcms-ht"
+ :entry-point "mulkcms-hunchentoot:run-server")
diff --git a/mulkcms-hunchentoot.lisp b/mulkcms-hunchentoot.lisp
index 4300871..4d7f3c1 100644
--- a/mulkcms-hunchentoot.lisp
+++ b/mulkcms-hunchentoot.lisp
@@ -75,5 +75,12 @@
:port *server-port*
:address *server-address*))
(setq mulkcms::*authorization-page-handler* #'handle-authorization-page)
- (hunchentoot:start *acceptor*))
+ (hunchentoot:start *acceptor*)
+ *acceptor*)
+(defun run-server ()
+ (let ((acceptor (start-server)))
+ (unwind-protect
+ (loop
+ (sleep 86400))
+ (stop acceptor :soft t))))
diff --git a/package-hunchentoot.lisp b/package-hunchentoot.lisp
index 955c25a..4843e0c 100644
--- a/package-hunchentoot.lisp
+++ b/package-hunchentoot.lisp
@@ -3,4 +3,4 @@
#:mulkcms)
(:nicknames #:mulkcms-ht)
(:shadow #:copy-file #:copy-stream)
- (:export #:start-server))
+ (:export #:start-server #:run-server))