Use docker volume for jekyll dependencies
Using a volume allows "caching" the bundled dependencies for jekyll. Created a "fresh" target for also removing volumes.
This commit is contained in:
parent
30b35f0cd4
commit
c8e8633639
3 changed files with 14 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
env:
|
||||
- IMAGE="yadm/jekyll:latest"
|
||||
- IMAGE="yadm/jekyll:2019-10-17"
|
||||
language: minimal
|
||||
services:
|
||||
- docker
|
||||
|
|
10
Makefile
10
Makefile
|
@ -1,4 +1,5 @@
|
|||
IGNORED = .jekyll-metadata Gemfile.lock _site
|
||||
VOLUME_ARG =
|
||||
|
||||
.PHONY: all
|
||||
all:
|
||||
|
@ -37,6 +38,9 @@ usage:
|
|||
@echo ' make clean'
|
||||
@echo ' - Remove previously built data and any jekyll containers.'
|
||||
@echo
|
||||
@echo ' make fresh'
|
||||
@echo ' - Like "make clean", but also removes the docker volumes.'
|
||||
@echo
|
||||
|
||||
.PHONY: test
|
||||
test: require-docker-compose clean
|
||||
|
@ -62,12 +66,16 @@ restart: require-docker-compose
|
|||
|
||||
.PHONY: down
|
||||
down: require-docker-compose
|
||||
docker-compose down --remove-orphans
|
||||
docker-compose down --remove-orphans ${VOLUME_ARG}
|
||||
|
||||
.PHONY: clean
|
||||
clean: down
|
||||
rm -rf ${IGNORED}
|
||||
|
||||
.PHONY: fresh
|
||||
fresh: VOLUME_ARG = -v
|
||||
fresh: clean
|
||||
|
||||
.PHONY: require-docker-compose
|
||||
require-docker-compose: require-docker
|
||||
@if ! command -v "docker-compose" >/dev/null 2>&1; then \
|
||||
|
|
|
@ -2,9 +2,12 @@
|
|||
version: '3'
|
||||
services:
|
||||
website:
|
||||
image: yadm/jekyll:latest
|
||||
image: yadm/jekyll:2019-10-17
|
||||
ports:
|
||||
- 4000:4000
|
||||
volumes:
|
||||
- .:/srv/jekyll
|
||||
- jekyll-bundle:/usr/local/bundle
|
||||
command: jekyll serve --config _config.yml,_dev.yml -t --watch --incremental
|
||||
volumes:
|
||||
jekyll-bundle:
|
||||
|
|
Loading…
Reference in a new issue