aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVeikka Kähkönen <insiding@gmail.com>2017-10-17 21:06:49 +0300
committerVeikka Kähkönen <insiding@gmail.com>2017-10-17 21:06:49 +0300
commit5fdc772599a8c695697f388b635679af07a24a2e (patch)
tree3b1ffabba963035319cfb7b0ba78ab14666e8e92
parentba809c038aea0b8e337f540b893449caf2505115 (diff)
Refactor jekyll.docker to allow partial rebuilds when the site changes
-rw-r--r--docker-compose.yml2
-rw-r--r--jekyll.docker9
2 files changed, 7 insertions, 4 deletions
diff --git a/docker-compose.yml b/docker-compose.yml
index 95871f3..b845967 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -4,6 +4,8 @@ services:
build:
context: "."
dockerfile: "jekyll.docker"
+ args:
+ - COMMIT_HASH=${COMMIT_HASH}
volumes_from:
- nginx
diff --git a/jekyll.docker b/jekyll.docker
index a4c57e8..d68843a 100644
--- a/jekyll.docker
+++ b/jekyll.docker
@@ -1,13 +1,14 @@
FROM alpine
MAINTAINER Your Name "your@name.com"
-RUN apk update
-RUN apk add ruby ruby-dev libffi-dev build-base git
+VOLUME ["/usr/share/nginx/html"]
+
+RUN apk update && apk add ruby ruby-dev libffi-dev build-base git
RUN gem install jekyll json --no-doc --no-ri
+ARG COMMIT_HASH
+
RUN git clone --single-branch --depth 1 https://github.com/kauha/uudempiAS.git \
/data/site-git
-VOLUME ["/usr/share/nginx/html"]
-
CMD ["jekyll", "build", "--source=/data/site-git", "--destination=/usr/share/nginx/html"]