Last active
June 27, 2018 04:17
-
-
Save jsoendermann/bff0054a85025865c2866072016098a4 to your computer and use it in GitHub Desktop.
Serve jekyll site with nginx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM alpine:3.7 as build-env | |
MAINTAINER Jan Soendermann | |
# This list of packages was taken from the official jekyll image. | |
# Some of them are probably not required but since this is | |
# just a build env, it doesn't matter so much. | |
RUN \ | |
apk --update add readline readline-dev libxml2 libxml2-dev libxslt \ | |
libxslt-dev python zlib zlib-dev ruby ruby-dev yaml \ | |
yaml-dev libffi libffi-dev build-base nodejs ruby-io-console \ | |
ruby-irb ruby-json ruby-rake ruby-rdoc ruby-dev | |
RUN gem install bundler -v 1.16.1 --no-document | |
RUN bundle config --global silence_root_warning 1 | |
RUN echo "gem: --no-rdoc --no-ri" > ~/.gemrc | |
WORKDIR /jekyll | |
COPY Gemfile . | |
COPY Gemfile.lock . | |
RUN bundle install --jobs 3 | |
COPY . . | |
RUN bundle exec jekyll build --destination /site | |
FROM nginx:1.15.0 | |
COPY --from=build-env /site /usr/share/nginx/html | |
EXPOSE 80 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment