about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@gmail.com>2015-11-29T15·52+0100
committerVincent Ambo <tazjin@gmail.com>2015-11-29T15·52+0100
commite949c5e812dbe06f441ac5381492b08f683e9f25 (patch)
tree1dba9b443441ee2145884c923f266b3694d3bcc9
parent792fe17f359b63a352e981dd3683179483d51236 (diff)
[build] Cache Docker dependencies
-rw-r--r--Dockerfile8
1 files changed, 6 insertions, 2 deletions
diff --git a/Dockerfile b/Dockerfile
index 73ab1057a2ef..7d8b60582655 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,6 +1,11 @@
 FROM fpco/stack-build
 MAINTAINER Vincent Ambo <dev@tazj.in>
 
+# Cache dependencies
+ADD stack.yaml tazblog.cabal /opt/tazblog/
+WORKDIR /opt/tazblog
+RUN stack build --only-dependencies
+
 # Base setup
 VOLUME /var/tazblog
 EXPOSE 8000 8070
@@ -8,8 +13,7 @@ ENV PATH /root/.local/bin:$PATH
 
 # Build blog
 ADD . /opt/tazblog
-WORKDIR /opt/tazblog
-RUN stack install && cp /root/.local/bin/tazblog /usr/bin/tazblog
+RUN stack install && cp /root/.local/bin/tazblog* /usr/bin/
 
 # Done!
 CMD tazblog