Skip to content
This repository was archived by the owner on Feb 14, 2023. It is now read-only.

Commit 4cb73e1

Browse files
Remove env file need (#34)
1 parent c397fab commit 4cb73e1

File tree

4 files changed

+23
-54
lines changed

4 files changed

+23
-54
lines changed

.env.template

-14
This file was deleted.

docker-compose.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
version: '3.2'
33
services:
44
mkdocs:
5-
container_name: mkdocs-serve-${PROJECT:-project}
5+
container_name: mkdocs-serve-template-site
66
ports:
77
- "0.0.0.0:8000:8000"
8-
image: ghcr.io/consensys/doctools-builder:${DOCTOOLS_IMAGE_VERSION:-latest}
8+
image: ghcr.io/consensys/doctools-builder:latest
99
working_dir: /workspace/
10-
env_file: .env
1110
volumes:
1211
- type: bind
1312
source: .
1413
target: /workspace
14+
environment:
15+
- PREBUILD_INDEX=false

docs/create/advanced/create-site-template.md

+19-27
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,6 @@ We recommend the following configuration:
5353
└── doctools.action-builder
5454
```
5555

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-
6656
1. Create a new file name `docker-compose.dev.yml` in the `doctools.template-site` directory with the following content:
6757

6858
!!! example "`docker-compose.dev.yml`"
@@ -72,14 +62,13 @@ We recommend the following configuration:
7262
version: '3.2'
7363
services:
7464
mkdocs:
75-
container_name: mkdocs-serve-dev-${PROJECT:-project}
65+
container_name: mkdocs-serve-dev-doctools
7666
ports:
7767
- "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
7969
build:
8070
context: ../doctools.action-builder/
8171
working_dir: /workspace/
82-
env_file: .env.dev
8372
command: ["serve", "--watch-theme", "--dirtyreload" ,"--dev-addr", "0.0.0.0:8000"]
8473
volumes:
8574
- type: bind
@@ -88,14 +77,18 @@ We recommend the following configuration:
8877
- type: bind
8978
source: ../doctools.action-builder/common
9079
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
9190
```
9291

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-
9992
You can make the following changes to the development environment variables:
10093

10194
- `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:
107100
- `PREBUILD_INDEX=true|false` - Remove or set to `false` to prevent the search index to be generated at each build
108101
and speed up the build.
109102
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.
112104
113105
## Preview the template
114106
115107
1. To preview the documentation site template locally, go to your site directory and run:
116108
117109
```bash
118-
docker compose -f docker-compose.dev.yml --env-file ./.env.dev up
110+
docker compose -f docker-compose.dev.yml up
119111
```
120112
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.
122114
123115
1. If you keep the Docker compose service running, the site preview automatically reloads and displays most changes.
124116
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:
127119

128120
```bash
129-
docker compose restart mkdocs
121+
docker compose -f docker-compose.dev.yml restart
130122
```
131123

132124
1. To stop the service, press ++ctrl+c++.
133125
Remove containers by running:
134126

135127
```bash
136-
docker compose down mkdocs
128+
docker compose -f docker-compose.dev.yml down
137129
```
138130

139131
[Doctools action builder]: https://github.com/ConsenSys/doctools.action-builder

docs/preview/new-system.md

-10
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,6 @@ With Docker running, follow these steps to preview your documentation site local
2424
docker pull ghcr.io/consensys/doctools-builder:latest
2525
```
2626

27-
1. Make a copy of the `.env.template` file provided, naming it `.env`:
28-
29-
```bash
30-
cp .env.template .env
31-
```
32-
33-
!!! note
34-
35-
You can update this environment variable file as described in the template.
36-
3727
1. In the project directory, run:
3828

3929
```bash

0 commit comments

Comments
 (0)