Skip to content

Commit c79075a

Browse files
committed
Copy the Docker-based setup from docs.scala-lang
That should fix the problems people report when they try to build the website.
1 parent 28ea574 commit c79075a

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
FROM ruby:2.6
1+
FROM ruby:2.6.9
22

3-
RUN gem install bundler jekyll
3+
RUN gem install rouge -v3.30.0
4+
RUN gem install bundler:2.3.10 jekyll
45

56
WORKDIR /srv/jekyll
67

78
COPY Gemfile .
89
COPY Gemfile.lock .
910

11+
RUN chmod u+s /bin/chown
1012
RUN bundle install

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ Markdown.
1818
## Building the site
1919
Make sure you are in the root directory of the cloned repository.
2020
### With `docker-compose`:
21-
```
22-
docker-compose up
23-
```
2421

25-
When the website dependencies change (the content of the `Gemfile`),
26-
you have to re-build the Docker image:
22+
To build and view site with Docker:
2723

28-
```
29-
docker-compose up --build
30-
```
24+
env UID="$(id -u)" GID="$(id -g)" docker-compose up
25+
26+
It will incrementally build and serve site at `http://localhost:4000`.
27+
28+
In case the Dockerfile changed, re-build it with:
29+
30+
env UID="$(id -u)" GID="$(id -g)" docker-compose up --build
3131

3232
### With Bundler:
3333

docker-compose.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
version: "2"
1+
version: '2'
2+
23
services:
3-
scala-lang:
4+
jekyll:
5+
user: "${UID}:${GID}"
46
build: .
5-
command: bundle exec jekyll serve --incremental --host=0.0.0.0
7+
command: sh -c "chown $UID / && bundle exec jekyll serve --incremental --host=0.0.0.0 "
68
ports:
7-
- 4000:4000
9+
- '4000:4000'
810
volumes:
911
- .:/srv/jekyll

0 commit comments

Comments
 (0)