Skip to content

Commit eb6ead9

Browse files
author
Jeff Knight
authored
use docker-compose for more reliable dev builds (#65)
1 parent 44c3067 commit eb6ead9

File tree

4 files changed

+14
-19
lines changed

4 files changed

+14
-19
lines changed

.circleci/config.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ jobs:
99
- run:
1010
name: Build static site
1111
command: |
12-
1312
ENV=development
1413
1514
if [ "${CIRCLE_BRANCH}" == "master" ]; then
@@ -19,7 +18,7 @@ jobs:
1918
ENV=staging
2019
fi;
2120
22-
JEKYLL_ENV=$ENV make docker-build
21+
docker run --rm -e "JEKYLL_ENV=$ENV" -e "PLATFORM_API_TOKEN=$PLATFORM_API_TOKEN" --volume="$PWD:/srv/jekyll" -it jekyll/jekyll make build
2322
2423
- run:
2524
name: Publish to Trebuchet

Makefile

-16
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@ BIN := ./node_modules/.bin
33
# Core...
44
JEKYLL_ENV ?= development
55

6-
DOCKER_TTY := docker run --rm \
7-
-e "JEKYLL_ENV=$(JEKYLL_ENV)" \
8-
-e "PLATFORM_API_TOKEN=$(PLATFORM_API_TOKEN)" \
9-
-p 127.0.0.1:4000:4000/tcp \
10-
--volume="$(PWD):/srv/jekyll" \
11-
--volume="$(PWD)/vendor/bundle:/usr/local/bundle" \
12-
-it jekyll/jekyll
13-
146
.PHONY: dev
157
dev: node_modules vendor/bundle
168
@$(BIN)/concurrently --raw --kill-others -n webpack,jekyll \
@@ -64,14 +56,6 @@ node_modules: package.json yarn.lock
6456
vendor/bundle: Gemfile Gemfile.lock
6557
bundle install
6658

67-
.PHONY: docker-dev
68-
docker-dev:
69-
$(DOCKER_TTY) make dev
70-
71-
.PHONY: docker-build
72-
docker-build:
73-
@$(DOCKER_TTY) make build
74-
7559
#.PHONY: docs
7660
#docs: node_modules
7761
# $(BIN)/webpack --mode=production

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ You can make a limited range of edits from the Github site, but this system work
66

77
# Quickstart (local development with docker)
88
You will need to have Docker installed https://docs.docker.com/install/
9-
* If using Linux, run `make docker-dev`
9+
* If using Linux, run `docker-compose up`
1010
* Visit http://localhost:4000/docsv2/
1111

1212
# Local development with `ruby` and `node`, without platform-api

docker-compose.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: '3'
2+
3+
services:
4+
jekyll:
5+
command: make dev
6+
image: jekyll/jekyll:latest
7+
volumes:
8+
- '.:/srv/jekyll'
9+
- './vendor/bundle:/usr/local/bundle'
10+
ports:
11+
- 4000:4000
12+
container_name: jekyll

0 commit comments

Comments
 (0)