@@ -53,16 +53,6 @@ We recommend the following configuration:
53
53
└── doctools.action-builder
54
54
` ` `
55
55
56
- 1. Pull latest Docker image:
57
-
58
- ` ` ` bash
59
- docker pull ghcr.io/consensys/doctools-builder:latest
60
- ` ` `
61
-
62
- !!! note
63
-
64
- Pull the latest Docker image when using the ` latest` Docker image tag.
65
-
66
56
1. Create a new file name ` docker-compose.dev.yml` in the ` doctools.template-site` directory with the following content:
67
57
68
58
!!! example " ` docker-compose.dev.yml` "
@@ -72,14 +62,13 @@ We recommend the following configuration:
72
62
version: ' 3.2'
73
63
services:
74
64
mkdocs:
75
- container_name: mkdocs-serve-dev-${PROJECT :- project}
65
+ container_name: mkdocs-serve-dev-doctools
76
66
ports:
77
67
- " 0.0.0.0:8000:8000"
78
- image: ghcr.io/consensys/doctools-builder:${DOCTOOLS_IMAGE_VERSION :- dev}
68
+ image: ghcr.io/consensys/doctools-builder:dev
79
69
build:
80
70
context: ../doctools.action-builder/
81
71
working_dir: /workspace/
82
- env_file: .env.dev
83
72
command: [" serve" , " --watch-theme" , " --dirtyreload" ," --dev-addr" , " 0.0.0.0:8000" ]
84
73
volumes:
85
74
- type: bind
@@ -88,14 +77,18 @@ We recommend the following configuration:
88
77
- type: bind
89
78
source: ../doctools.action-builder/common
90
79
target: /common
80
+ environment:
81
+ # uncomment to output debug infos in HTML source code. Requires MINIFY=false
82
+ # - DEBUG=true
83
+ # uncomment to prevent HTML/CSS/JS code to be minified. Useful for debugging theme.
84
+ - MINIFY=false
85
+ # uncomment to prevent search index prebuild, speeds up large sites build time.
86
+ - PREBUILD_INDEX=false
87
+ # uncomment and change to modify the preview port
88
+ # useful if running more than one local preview at the same time.
89
+ # - PORT=8001
91
90
` ` `
92
91
93
- 1. In the ` doctools.template-site` directory, make a copy of the ` .env.template` file, naming it ` .env.dev` :
94
-
95
- ` ` ` bash
96
- cp .env.template .env.dev
97
- ` ` `
98
-
99
92
You can make the following changes to the development environment variables:
100
93
101
94
- ` DEBUG=true| false` - Remove or set to ` false` to hide debug comments, set to ` true` to show debug comments inside
@@ -107,33 +100,32 @@ We recommend the following configuration:
107
100
- ` PREBUILD_INDEX=true| false` - Remove or set to ` false` to prevent the search index to be generated at each build
108
101
and speed up the build.
109
102
The default is ` true` as it' s useful for production.
110
- - `VERSION=string` - Set to a specific number to simulate a version locally.
111
- This value is otherwise initialized by CI.
103
+ - `PORT=number` - Set to a specific port number. useful if running more than one local preview at the same time.
112
104
113
105
## Preview the template
114
106
115
107
1. To preview the documentation site template locally, go to your site directory and run:
116
108
117
109
```bash
118
- docker compose -f docker-compose.dev.yml --env-file ./.env.dev up
110
+ docker compose -f docker-compose.dev.yml up
119
111
```
120
112
121
- You can see the preview at `http://0.0.0.0:8000`.
113
+ You can see the preview at `http://0.0.0.0:8000` by default .
122
114
123
115
1. If you keep the Docker compose service running, the site preview automatically reloads and displays most changes.
124
116
125
- If you make changes to `.env.dev` or assets outside of the `docs` folder, the system doesn ' t reload automatically and
126
- you must restart Docker compose to view the changes:
117
+ If you make changes to environment variables in `docker-compose.dev.yml`,
118
+ the system doesn ' t reload automatically and you must restart Docker compose to view the changes:
127
119
128
120
` ` ` bash
129
- docker compose restart mkdocs
121
+ docker compose -f docker-compose.dev.yml restart
130
122
` ` `
131
123
132
124
1. To stop the service, press ++ctrl+c++.
133
125
Remove containers by running:
134
126
135
127
` ` ` bash
136
- docker compose down mkdocs
128
+ docker compose -f docker-compose.dev.yml down
137
129
` ` `
138
130
139
131
[Doctools action builder]: https://github.com/ConsenSys/doctools.action-builder
0 commit comments