-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dockerfile (with some convenience Makerules) for development, testing and serving #461
Changes from 9 commits
21b1871
c192457
4ac341c
76e40e0
ab2a31f
4f97a96
1ffa175
4735c43
46e410d
5733af2
2bb738f
209aa53
a7a7e73
1381be0
0a6fc82
6cfbab0
a31946e
3b30541
21101e2
cbe4cdf
03709aa
9d8fe18
f4a8d87
bc487a3
8b6a3d2
9d3ffff
be1ac57
7753628
72f81a3
c09e851
b3b4b84
e8eb664
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM ruby:2.4 | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
git \ | ||
make | ||
|
||
COPY . /gh-pages | ||
WORKDIR /gh-pages | ||
|
||
RUN bundle config local.github-pages /gh-pages | ||
RUN bundle install | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We may need to modify the Gemfile to add the Gem to the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure I totally understand what you mean with this, please elaborate and I'll try to get on it asap 😉. My GitHub Pages projects do contain the Is there any logic performed on the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The Jekyll Plugins group allows the GitHub Pages Gem to get bootstrapped earlier in Jekyll's process and set configuration defaults and constraints to match GitHub Pages. I'm struggling to load a gemspec into a gem group, so we may need to create a new / modify the Gemfile for docker. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have you guys figures this out in the end? It seems to me that jekyll in the container ignores github-pages entirely and just uses its own default configuration, making this whole |
||
|
||
CMD ["jekyll", "serve", "-H", "0.0.0.0", "-P", "4000"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
DOCKER=docker | ||
|
||
TAG=gh-pages | ||
|
||
# Build the docker image | ||
image: | ||
${DOCKER} build -t ${TAG} . | ||
|
||
# Produce a bash shell | ||
shell: | ||
${DOCKER} run --rm -it \ | ||
-p 4000:4000 \ | ||
-v ${PWD}:/gh-pages \ | ||
${TAG} \ | ||
/bin/bash | ||
|
||
# Spawn a server. Specify the path to the SITE directory by | ||
# exposing it using `expose SITE="../path-to-jekyll-site"` prior to calling or | ||
# by prepending it to the make rule e.g.: `SITE=../path-to-site make server` | ||
server: | ||
ls "${SITE}" >/dev/null && \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can an error message be printed here if the SITE variable doesn't exist? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will an |
||
${DOCKER} run --rm -it \ | ||
-p 4000:4000 \ | ||
-v ${PWD}:/gh-pages \ | ||
-v `realpath ${SITE}`:/site \ | ||
-w /site \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done 😉 9d8fe18 |
||
${TAG} | ||
|
||
.PHONY: | ||
image server shell |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to how
Jekyll.sanitized_path
works, let's put this in a subdirectory 2 levels deep, e.g./gh/pages
or/src/gh-pages
. Otherwise, if you have a file calledgh-pages.html
, you'll get an error. It's confusing so let's tackle that before merging.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like cbe4cdf?