Skip to content

Commit

Permalink
Use docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
normartin committed Nov 6, 2023
1 parent cec5f9d commit e611cab
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 108 deletions.
93 changes: 0 additions & 93 deletions Gemfile.lock

This file was deleted.

15 changes: 15 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM ruby:2.7

ENV BUNDLE_GEMFILE=/app/bundle/Gemfile

WORKDIR /app/bundle

ADD Gemfile .

RUN bundle install

RUN mkdir /app/src

WORKDIR /app/src

ENTRYPOINT ["bundle", "exec", "jekyll"]
File renamed without changes.
27 changes: 12 additions & 15 deletions go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,28 @@ set -e
export JEKYLL_VERSION=3.8

goal_serve() {
docker run --rm \
--volume="$PWD:/usr/src/app" \
--volume="$PWD/vendor/bundle/gems:/usr/local/bundle" \
--workdir=/usr/src/app \
--env FORCE_POLLING=true \
-p 4000:4000 \
-p 40000:40000 \
-it ruby:2.7 \
bash -c "bundle install && bundle exec jekyll serve --drafts --livereload --livereload_port 40000 --force_polling --incremental"
goal_docker

docker run --rm -p 4000:4000 -p 40000:40000 -v $(pwd):/app/src jekyll-container serve\
--host 0.0.0.0 --drafts --livereload --livereload_port 40000 --force_polling
}

goal_build() {
docker run --rm \
--volume="$PWD:/srv/jekyll:Z" \
--volume="$PWD/vendor/bundle:/usr/local/bundle:Z" \
--env JEKYLL_ENV=production \
jekyll/builder:$JEKYLL_VERSION \
jekyll build
goal_docker
rm -rf _site
docker run --rm -p 4000:4000 -p 40000:40000 --env JEKYLL_ENV=production -v $(pwd):/app/src jekyll-container build
}

goal_docker() {
docker build -t jekyll-container docker
}

goal_help() {
echo "usage: $0 <goal>
available goals
serve -- serve the blog locally (http://localhost:4000)
build -- build the blog (builds static artifact for publishing)
docker -- creates docker build image (tag: jekyll-container)
"
exit 1
}
Expand Down

0 comments on commit e611cab

Please sign in to comment.