Skip to content

Instantly share code, notes, and snippets.

@exegeteio
Created December 1, 2020 17:56
Show Gist options
  • Save exegeteio/94031d431d735acd6ccddb3c2ab223e3 to your computer and use it in GitHub Desktop.
Save exegeteio/94031d431d735acd6ccddb3c2ab223e3 to your computer and use it in GitHub Desktop.
Jekyll Dockerfile with intermediate containers, deploying with nginx.
FROM ruby:2.6 AS jekyll
WORKDIR /usr/src/app
COPY Gemfile Gemfile.lock /usr/src/app/
RUN bundle install --quiet -j 4
COPY . /usr/src/app/
EXPOSE 3000
CMD jekyll server -P 3000 -H 0.0.0.0 -w --force_polling --incremental
FROM jekyll AS website
ENV JEKYLL_ENV=production
RUN jekyll build
FROM nginx AS final
COPY _nginx/default.conf /etc/nginx/conf.d/default.conf
WORKDIR /usr/share/www
COPY --from=website /usr/src/app/docs /usr/share/www/
EXPOSE 5000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment