Skip to content

Commit 3a3b610

Browse files
darosiorstickies-v
andcommitted
contrib: add a Dockerfile to run the website locally
Co-Authored-By: stickies-v <[email protected]>
1 parent 7c34ca7 commit 3a3b610

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-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: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
RUN apt update && apt install -y make
8+
9+
WORKDIR /site
10+
11+
COPY Gemfile* .
12+
13+
RUN gem install bundler \
14+
&& bundle install
15+
16+
# Default Jekyll port
17+
EXPOSE 4000
18+
19+
CMD ["bundle", "exec", "jekyll", "serve", "--future", "--drafts", "--unpublished", "--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)