Skip to content

Commit 76e93a2

Browse files
authored
Improve documentation about Docker
1 parent 1756c73 commit 76e93a2

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

README.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,31 @@ Markdown.
1717

1818
## Building the site
1919
Make sure you are in the root directory of the cloned repository.
20-
### With `docker-compose`:
20+
### With `Docker Compose`:
2121

22-
To build and view site with Docker:
22+
You need to have [Docker Engine](https://docs.docker.com/engine/) and [Docker Compose](https://docs.docker.com/compose/) installed on your machine.
23+
Under macOS (Intel or Apple silicon), instead of installing [Docker Desktop](https://docs.docker.com/desktop/) you can also use [HomeBrew](https://brew.sh/) with [Colima](https://github.com/abiosoft/colima): `brew install colima docker`.
24+
UID and GID environment variables are needed to avoid docker from writing files as root in your directory.
2325

24-
env UID="$(id -u)" GID="$(id -g)" docker-compose up
26+
```
27+
env UID="$(id -u)" GID="$(id -g)" docker-compose up
28+
```
29+
30+
The generated site is available at `http://localhost:4000`.
2531

26-
It will incrementally build and serve site at `http://localhost:4000`.
32+
When the website dependencies change (the content of the `Gemfile`),
33+
you have to re-build the Docker image:
34+
35+
```
36+
env UID="$(id -u)" GID="$(id -g)" docker-compose up --build
37+
```
38+
39+
If you have problems with the Docker image or want to force the rebuild of the Docker image:
40+
```
41+
env UID="$(id -u)" GID="$(id -g)" docker-compose build --no-cache
42+
```
2743

28-
In case the Dockerfile changed, re-build it with:
2944

30-
env UID="$(id -u)" GID="$(id -g)" docker-compose up --build
3145

3246
### With Bundler:
3347

0 commit comments

Comments
 (0)