docs: Add docker compose workflow for running docs locally (#5400)
* docs: Add docker compose workflow for running docs locally * chore: Fixup compose.yaml for local build: - Added comments - Use the verbose mount syntax - Wrap /Users/ja/Documents/GitHub/docs-v2 in quotes for cross-platform compat. * docs: fixup readme style Co-authored-by: Jason Stirnaman <stirnamanj@gmail.com> * docs: fixup readme style Co-authored-by: Jason Stirnaman <stirnamanj@gmail.com> * docs: fixup readme style Co-authored-by: Jason Stirnaman <stirnamanj@gmail.com> --------- Co-authored-by: Jason Stirnaman <stirnamanj@gmail.com>pull/5403/head^2
parent
8f3947ec92
commit
86f832f06c
13
README.md
13
README.md
|
@ -52,3 +52,16 @@ including our GPG key, can be found at https://www.influxdata.com/how-to-report-
|
|||
npx hugo server
|
||||
```
|
||||
5. View the docs at [localhost:1313](http://localhost:1313).
|
||||
|
||||
### Alternative: Use docker compose
|
||||
|
||||
1. Clone this repository to your local machine. See how to [clone a repository](https://help.github.com/articles/cloning-a-repository/).
|
||||
|
||||
2. Follow the instructions to [install Docker Desktop](https://docs.docker.com/desktop/) and [Docker Compose](https://docs.docker.com/compose/) to your local machine.
|
||||
|
||||
3. Use Docker Compose to start the Hugo server in development mode--for example, enter the following command in your terminal:
|
||||
|
||||
```sh
|
||||
docker compose up local-dev
|
||||
```
|
||||
4. View the docs at [localhost:1313](http://localhost:1313).
|
||||
|
|
19
compose.yaml
19
compose.yaml
|
@ -1,5 +1,5 @@
|
|||
# For examples, see the Awesome Compose repository:
|
||||
# https://github.com/docker/awesome-compose
|
||||
# This is a Docker Compose file for the InfluxData documentation site.
|
||||
## Run documentation tests for code samples.
|
||||
services:
|
||||
test:
|
||||
image: docs-v2-tests
|
||||
|
@ -19,3 +19,18 @@ services:
|
|||
args:
|
||||
- SOURCE_DIR=test
|
||||
- DOCKER_IMAGE=docs-v2-tests
|
||||
## Run InfluxData documentation with the hugo development server on port 1313.
|
||||
## For more information about the hugomods/hugo image, see
|
||||
## https://docker.hugomods.com/docs/development/docker-compose/
|
||||
local-dev:
|
||||
image: hugomods/hugo:exts-0.123.8
|
||||
command: hugo server --bind 0.0.0.0
|
||||
ports:
|
||||
- 1313:1313
|
||||
volumes:
|
||||
- type: bind
|
||||
source: "$PWD"
|
||||
target: /src
|
||||
- type: bind
|
||||
source: $HOME/hugo_cache
|
||||
target: /tmp/hugo_cache
|
||||
|
|
Loading…
Reference in New Issue