codecheckers / codecheckers.github.io

CODECHECK project website and material (badges, logos, specifications)
https://codecheck.org.uk
Creative Commons Attribution Share Alike 4.0 International
0 stars 2 forks source link

Add a Dockerfile for rendering the page locally #6

Closed nuest closed 4 years ago

nuest commented 4 years ago

For irregular contributors, it could be easier to have a Docker image at hand to render the website for local previews. Add a custom Dockerfile and a target to the Makefile to realise this.

A custom Dockerfile should be pretty straightforward and makes sense because of the needed Ruby packages - even existing Jekyll containers are unlikely to have all plug-ins the page uses.

nuest commented 4 years ago

@sje30 Let me know if make preview_container works for you!

(Note that it will take some time before the "open preview at" message comes, because the container reinstalls the Jekyll dependencies every time. We can add our own Dockerfile to fix that, but spontaneously I think that maintenance is hard than waiting 20 seconds.)

nuest commented 4 years ago
$ make preview_container 
docker run --rm -it -p 80:4000 -v /home/daniel/git/codecheck/codecheckers.github.io:/srv/jekyll jekyll/jekyll:stable jekyll serve --trace
Fetching gem metadata from https://rubygems.org/.........
Fetching public_suffix 4.0.1
Installing public_suffix 4.0.1
Using addressable 2.7.0
Using bundler 2.1.4
Using colorator 1.1.0
Fetching concurrent-ruby 1.1.5
Installing concurrent-ruby 1.1.5
Using eventmachine 1.2.7
Using http_parser.rb 0.6.0
Using em-websocket 0.5.1
Fetching ffi 1.12.1
Installing ffi 1.12.1 with native extensions
Using forwardable-extended 2.6.0
Using i18n 0.9.5
Fetching rb-fsevent 0.10.3
Installing rb-fsevent 0.10.3
Using rb-inotify 0.10.1
Using sass-listen 4.0.0
Using sass 3.7.4
Using jekyll-sass-converter 1.5.2
Using listen 3.2.1
Using jekyll-watch 2.2.1
Using kramdown 1.17.0
Using liquid 4.0.3
Using mercenary 0.3.6
Using pathutil 0.16.2
Fetching rouge 3.13.0
Installing rouge 3.13.0
Using safe_yaml 1.0.5
Fetching jekyll 3.8.6
Installing jekyll 3.8.6
Fetching jekyll-redirect-from 0.15.0
Installing jekyll-redirect-from 0.15.0
Fetching rubyzip 2.1.0
Installing rubyzip 2.1.0
Fetching jekyll-remote-theme 0.4.1
Installing jekyll-remote-theme 0.4.1
Using jekyll-seo-tag 2.6.1
Fetching minima-reboot 1.0.26
Installing minima-reboot 1.0.26
Bundle complete! 6 Gemfile dependencies, 30 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux-musl]
Configuration file: /srv/jekyll/_config.yml
      Remote Theme: Using theme aterenin/minima-reboot
            Source: /srv/jekyll
       Destination: /srv/jekyll/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
      Remote Theme: Using theme aterenin/minima-reboot
                    done in 0.519 seconds.
 Auto-regeneration: enabled for '/srv/jekyll'
    Server address: http://0.0.0.0:4000/
  Server running... press ctrl-c to stop.