Last active
April 6, 2023 01:23
-
-
Save pgib/44bcd057a1b4fe207c106b46041fa3ec to your computer and use it in GitHub Desktop.
Run Jekyll in Docker
This file contains hidden or 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
#!/bin/sh | |
docker build --tag jekyll:latest . |
This file contains hidden or 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 ruby:3.2-bullseye AS build | |
WORKDIR /jekyll | |
RUN bundle config set --global path /vendor | |
RUN bundle config set --global without development | |
COPY Gemfile Gemfile.lock /jekyll | |
RUN bundle install | |
FROM ruby:3.2-slim-bullseye | |
COPY --from=build /vendor /vendor | |
COPY --from=build /root/.bundle /root/.bundle | |
ENV LANG C.UTF-8 | |
WORKDIR /jekyll | |
EXPOSE 4000 | |
CMD [ "bundle", "exec", "jekyll", "build" ] |
This file contains hidden or 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
#!/bin/sh | |
docker run \ | |
--rm \ | |
--volume $(pwd):/jekyll \ | |
jekyll:latest | |
This file contains hidden or 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
#!/bin/sh | |
docker run \ | |
--rm \ | |
-it \ | |
--volume $(pwd):/jekyll \ | |
--publish 4000:4000 \ | |
jekyll:latest \ | |
bundle exec jekyll serve --host 0.0.0.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment