Skip to content

Commit 86f832f

Browse files
waynrjstirnaman
andauthored
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 <[email protected]> * docs: fixup readme style Co-authored-by: Jason Stirnaman <[email protected]> * docs: fixup readme style Co-authored-by: Jason Stirnaman <[email protected]> --------- Co-authored-by: Jason Stirnaman <[email protected]>
1 parent 8f3947e commit 86f832f

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

README.md

+13
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,16 @@ including our GPG key, can be found at https://www.influxdata.com/how-to-report-
5252
npx hugo server
5353
```
5454
5. View the docs at [localhost:1313](http://localhost:1313).
55+
56+
### Alternative: Use docker compose
57+
58+
1. Clone this repository to your local machine. See how to [clone a repository](https://help.github.com/articles/cloning-a-repository/).
59+
60+
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.
61+
62+
3. Use Docker Compose to start the Hugo server in development mode--for example, enter the following command in your terminal:
63+
64+
```sh
65+
docker compose up local-dev
66+
```
67+
4. View the docs at [localhost:1313](http://localhost:1313).

compose.yaml

+17-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# For examples, see the Awesome Compose repository:
2-
# https://github.com/docker/awesome-compose
1+
# This is a Docker Compose file for the InfluxData documentation site.
2+
## Run documentation tests for code samples.
33
services:
44
test:
55
image: docs-v2-tests
@@ -19,3 +19,18 @@ services:
1919
args:
2020
- SOURCE_DIR=test
2121
- DOCKER_IMAGE=docs-v2-tests
22+
## Run InfluxData documentation with the hugo development server on port 1313.
23+
## For more information about the hugomods/hugo image, see
24+
## https://docker.hugomods.com/docs/development/docker-compose/
25+
local-dev:
26+
image: hugomods/hugo:exts-0.123.8
27+
command: hugo server --bind 0.0.0.0
28+
ports:
29+
- 1313:1313
30+
volumes:
31+
- type: bind
32+
source: "$PWD"
33+
target: /src
34+
- type: bind
35+
source: $HOME/hugo_cache
36+
target: /tmp/hugo_cache

0 commit comments

Comments
 (0)