Skip to content

Commit 3a2961f

Browse files
committed
Merge #1184: contrib: add a Dockerfile to run the website locally
414b2cf contrib: add a Dockerfile to run the website locally (Antoine Poinsot) Pull request description: It was useful to me, so i cleaned it up and PR'd it in case others do not have a full Ruby toolchain installed, but do have Docker. ACKs for top commit: stickies-v: ACK 414b2cf - thanks for addressing my comments! glozow: ACK 414b2cf, this is super useful for testing changes Tree-SHA512: d2dbad99d5e69301348d6bffdd6dd690b35a6d9f7e25af1c03dd81b042ce96d396143d9eb5bce60ca0de8177e37c71aaf2ec36841243749bdc248744b986b097
2 parents 74b528c + 414b2cf commit 3a2961f

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ permalink: /en/2016/01/01/short-title
4242

4343
This website is based on [Jekyll](https://jekyllrb.com/). To build
4444
locally, [install Ruby 3.1.2](https://gorails.com/setup) using system
45-
packages, [rvm](https://rvm.io), [rbenv](https://github.com/rbenv/rbenv), or another method.
45+
packages, [rvm](https://rvm.io), [rbenv](https://github.com/rbenv/rbenv), or another method. An
46+
alternative is to use Docker, for which instructions are available [here](./contrib/devtools/).
4647
Then clone this repository and change directory into it:
4748

4849
git clone https://github.com/bitcoin-core/bitcoincore.org.git

contrib/devtools/Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM ruby:3.1.2
2+
3+
ENV NOKOGIRI_USE_SYSTEM_LIBRARIES=true
4+
ENV JEKYLL_ENV=production
5+
ENV RUBYOPT="-KU -E utf-8:utf-8"
6+
7+
WORKDIR /site
8+
9+
COPY Gemfile* .
10+
11+
RUN gem install bundler \
12+
&& bundle install
13+
14+
# Default Jekyll port
15+
EXPOSE 4000
16+
17+
CMD ["bundle", "exec", "jekyll", "serve", "--future", "--drafts", "--unpublished", "--incremental", "--strict_front_matter", "--host", "0.0.0.0"]

contrib/devtools/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,20 @@ gribble (18)
2424
| luke-jr | [Luke Dashjr][] |
2525
[...]
2626
```
27+
28+
Dockerfile
29+
==========
30+
31+
Run the website locally without having to install the dependencies on your machine.
32+
33+
To build the image (from the root of the repository):
34+
```
35+
docker build -f ./contrib/devtools/Dockerfile -t corewebsite .
36+
```
37+
38+
Then the container can be run like so:
39+
```
40+
docker run -it --rm -v "$PWD":/site -p 4000:4000 corewebsite
41+
```
42+
43+
And the website can be accessed at https://localhost:4000.

0 commit comments

Comments
 (0)