Skip to content

Instantly share code, notes, and snippets.

@MikeRalphson
Last active March 15, 2023 09:02
Show Gist options
  • Save MikeRalphson/5b7c4b5c4ed78e8a26417fbb6abb934e to your computer and use it in GitHub Desktop.
Save MikeRalphson/5b7c4b5c4ed78e8a26417fbb6abb934e to your computer and use it in GitHub Desktop.
OAI gh-pages base Dockerfile
# https://github.com/BretFisher/jekyll-serve/blob/main/README.md license: MIT
FROM ruby:3.1-slim-bullseye as jekyll
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
git \
&& rm -rf /var/lib/apt/lists/*
# used in the jekyll-server image, which is FROM this image
COPY docker-entrypoint.sh /usr/local/bin/
RUN gem update --system && gem install jekyll && gem cleanup
EXPOSE 4000
WORKDIR /site
ENTRYPOINT [ "jekyll" ]
CMD [ "--help" ]
# build from the image we just built with different metadata
FROM jekyll as jekyll-serve
# on every container start, check if Gemfile exists and warn if it's missing
ENTRYPOINT [ "docker-entrypoint.sh" ]
CMD [ "bundle", "exec", "jekyll", "serve", "--force_polling", "-H", "0.0.0.0", "-P", "4000" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment