[build] Cache Docker dependencies

This commit is contained in:
Vincent Ambo 2015-11-29 16:52:17 +01:00
parent 792fe17f35
commit e949c5e812

View file

@ -1,6 +1,11 @@
FROM fpco/stack-build FROM fpco/stack-build
MAINTAINER Vincent Ambo <dev@tazj.in> 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 # Base setup
VOLUME /var/tazblog VOLUME /var/tazblog
EXPOSE 8000 8070 EXPOSE 8000 8070
@ -8,8 +13,7 @@ ENV PATH /root/.local/bin:$PATH
# Build blog # Build blog
ADD . /opt/tazblog ADD . /opt/tazblog
WORKDIR /opt/tazblog RUN stack install && cp /root/.local/bin/tazblog* /usr/bin/
RUN stack install && cp /root/.local/bin/tazblog /usr/bin/tazblog
# Done! # Done!
CMD tazblog CMD tazblog