diff --git a/README.md b/README.md index 2815db54b..5d8d05308 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,8 @@ permalink: /en/2016/01/01/short-title This website is based on [Jekyll](https://jekyllrb.com/). To build locally, [install Ruby 3.1.2](https://gorails.com/setup) using system -packages, [rvm](https://rvm.io), [rbenv](https://github.com/rbenv/rbenv), or another method. +packages, [rvm](https://rvm.io), [rbenv](https://github.com/rbenv/rbenv), or another method. An +alternative is to use Docker, for which instructions are available [here](./contrib/devtools/). Then clone this repository and change directory into it: git clone https://github.com/bitcoin-core/bitcoincore.org.git diff --git a/contrib/devtools/Dockerfile b/contrib/devtools/Dockerfile new file mode 100644 index 000000000..f4e389721 --- /dev/null +++ b/contrib/devtools/Dockerfile @@ -0,0 +1,29 @@ +FROM ruby:3.1.2 + +ENV NOKOGIRI_USE_SYSTEM_LIBRARIES=true +ENV JEKYLL_ENV=production +ENV RUBYOPT="-KU -E utf-8:utf-8" + +RUN apt update \ + && apt install -y \ + curl \ + jekyll \ + make \ + ruby \ + ruby-html-proofer \ + ruby-jekyll-redirect-from \ + ruby-kramdown-parser-gfm + +WORKDIR /site + +COPY . . + +RUN gem install bundler \ + && bundle install + +RUN make build + +# Default Jekyll port +EXPOSE 4000 + +CMD ["bundle", "exec", "jekyll", "server", "--host", "0.0.0.0", "--future"] diff --git a/contrib/devtools/README.md b/contrib/devtools/README.md index 9d67ed45e..076c0fe06 100644 --- a/contrib/devtools/README.md +++ b/contrib/devtools/README.md @@ -24,3 +24,20 @@ gribble (18) | luke-jr | [Luke Dashjr][] | [...] ``` + +Dockerfile +========== + +Run the website locally without having to install the dependencies on your machine. + +To build the image (from the root of the repository): +``` +docker build -f ./contrib/devtools/Dockerfile -t corewebsite . +``` + +Then the container can be run like so: +``` +docker run -it --rm -v "$PWD":/site -p 4000:4000 corewebsite +``` + +And the website can be accessed at https://localhost:4000.