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:
|
env:
|
||||||
- IMAGE="yadm/jekyll:latest"
|
- IMAGE="yadm/jekyll:2019-10-17"
|
||||||
language: minimal
|
language: minimal
|
||||||
services:
|
services:
|
||||||
- docker
|
- docker
|
||||||
|
|
10
Makefile
10
Makefile
|
@ -1,4 +1,5 @@
|
||||||
IGNORED = .jekyll-metadata Gemfile.lock _site
|
IGNORED = .jekyll-metadata Gemfile.lock _site
|
||||||
|
VOLUME_ARG =
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all:
|
all:
|
||||||
|
@ -37,6 +38,9 @@ usage:
|
||||||
@echo ' make clean'
|
@echo ' make clean'
|
||||||
@echo ' - Remove previously built data and any jekyll containers.'
|
@echo ' - Remove previously built data and any jekyll containers.'
|
||||||
@echo
|
@echo
|
||||||
|
@echo ' make fresh'
|
||||||
|
@echo ' - Like "make clean", but also removes the docker volumes.'
|
||||||
|
@echo
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test: require-docker-compose clean
|
test: require-docker-compose clean
|
||||||
|
@ -62,12 +66,16 @@ restart: require-docker-compose
|
||||||
|
|
||||||
.PHONY: down
|
.PHONY: down
|
||||||
down: require-docker-compose
|
down: require-docker-compose
|
||||||
docker-compose down --remove-orphans
|
docker-compose down --remove-orphans ${VOLUME_ARG}
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean: down
|
clean: down
|
||||||
rm -rf ${IGNORED}
|
rm -rf ${IGNORED}
|
||||||
|
|
||||||
|
.PHONY: fresh
|
||||||
|
fresh: VOLUME_ARG = -v
|
||||||
|
fresh: clean
|
||||||
|
|
||||||
.PHONY: require-docker-compose
|
.PHONY: require-docker-compose
|
||||||
require-docker-compose: require-docker
|
require-docker-compose: require-docker
|
||||||
@if ! command -v "docker-compose" >/dev/null 2>&1; then \
|
@if ! command -v "docker-compose" >/dev/null 2>&1; then \
|
||||||
|
|
|
@ -2,9 +2,12 @@
|
||||||
version: '3'
|
version: '3'
|
||||||
services:
|
services:
|
||||||
website:
|
website:
|
||||||
image: yadm/jekyll:latest
|
image: yadm/jekyll:2019-10-17
|
||||||
ports:
|
ports:
|
||||||
- 4000:4000
|
- 4000:4000
|
||||||
volumes:
|
volumes:
|
||||||
- .:/srv/jekyll
|
- .:/srv/jekyll
|
||||||
|
- jekyll-bundle:/usr/local/bundle
|
||||||
command: jekyll serve --config _config.yml,_dev.yml -t --watch --incremental
|
command: jekyll serve --config _config.yml,_dev.yml -t --watch --incremental
|
||||||
|
volumes:
|
||||||
|
jekyll-bundle:
|
||||||
|
|
Loading…
Reference in a new issue