diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..617f72e17 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM ruby:2.5 + +RUN gem install bundler jekyll + +WORKDIR /srv/jekyll + +COPY Gemfile . +COPY Gemfile.lock . + +RUN bundle install diff --git a/README.md b/README.md index 430f1374c..4eb446adc 100644 --- a/README.md +++ b/README.md @@ -17,12 +17,20 @@ Markdown. ## Building the site Make sure you are in the root directory of the cloned repository. -### For Compose: +### With `docker-compose`: ``` -bin/serve +docker-compose up ``` -### For Bundler: +When the website dependencies change (the content of the `Gemfile`), +you have to re-build the Docker image: + +``` +docker-compose up --build +``` + +### With Bundler: + ``` bundle install bundle exec jekyll serve --incremental diff --git a/bin/bundle b/bin/bundle deleted file mode 100755 index d14fe699a..000000000 --- a/bin/bundle +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -command -v docker-compose >/dev/null 2>&1 || { echo >&2 "Please install Docker Compose: https://docs.docker.com/compose/install/"; exit 1; } -docker-compose run --service-ports scala-lang bundle $@ diff --git a/bin/jekyll b/bin/jekyll deleted file mode 100755 index 16eb22f24..000000000 --- a/bin/jekyll +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -command -v docker-compose >/dev/null 2>&1 || { echo >&2 "Please install Docker Compose: https://docs.docker.com/compose/install/"; exit 1; } -docker-compose run --service-ports scala-lang jekyll $@ diff --git a/bin/serve b/bin/serve deleted file mode 100755 index 9e05fa696..000000000 --- a/bin/serve +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -command -v docker-compose >/dev/null 2>&1 || { echo >&2 "Please install Docker Compose: https://docs.docker.com/compose/install/"; exit 1; } -docker-compose run --service-ports scala-lang jekyll serve --incremental diff --git a/docker-compose.yml b/docker-compose.yml index 181dc8cd3..bfc376a36 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,12 +1,9 @@ version: "2" services: scala-lang: - image: jekyll/jekyll:latest - volumes: - - $PWD:/srv/jekyll - - $PWD/vendor/bundle:/usr/local/bundle + build: . + command: bundle exec jekyll serve --incremental --host=0.0.0.0 ports: - 4000:4000 - - 35729:35729 - - 3000:3000 - - 80:4000 \ No newline at end of file + volumes: + - .:/srv/jekyll