Skip to content

Commit

Permalink
contribute: update to use compose watch
Browse files Browse the repository at this point in the history
Signed-off-by: David Karlsson <[email protected]>
  • Loading branch information
dvdksn committed Aug 23, 2023
1 parent 2d8290f commit c379bec
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 22 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ FROM base as build-base
COPY --from=hugo $GOPATH/bin/hugo /bin/hugo
COPY --from=node /src/node_modules /src/node_modules

FROM build-base as dev
COPY . .

FROM build-base as build
ARG HUGO_ENV
ARG DOCS_URL
Expand Down
12 changes: 8 additions & 4 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ services:
server:
build:
context: .
target: build-base
volumes:
- "${PWD}:/src"
- /src/node_modules
target: dev
ports:
- "1313:1313"
entrypoint: ["hugo", "server", "--bind", "0.0.0.0"]
x-develop:
watch:
- action: sync
path: .
target: /src
ignore:
- node_modules/
31 changes: 14 additions & 17 deletions content/contribute/contribute-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,35 +66,32 @@ A Netlify test runs for each PR created against the `main` branch and deploys th

On your local machine, clone the docs repository:

```bash
git clone {{% param "repo" %}}.git
cd docs
```console
$ git clone {{% param "repo" %}}.git
$ cd docs
```

Then, build and run the documentation using [Docker Compose](../compose/index.md):

```bash
docker compose up -d --build
```console
$ docker compose up -d --build
$ docker compose alpha watch
```

> **Note**
>
>You need Docker Compose to build and run the docs locally. Docker Compose is included with [Docker Desktop](../desktop/index.md). If you don't have Docker Desktop installed, follow the [instructions](../compose/install/index.md) to install Docker Compose.
When the container is built and running, visit [http://localhost:4000](http://localhost:4000) in your web browser to view the docs.

To rebuild the docs after you made changes, run the `docker compose up` command
again. This rebuilds the docs, and updates the container with your changes:
When the container is built and running, visit [http://localhost:1313](http://localhost:1313) in your web browser to view the docs.

```bash
docker compose up -d --build
```
The [Docker Compose `watch`](../compose/file-watch.md) feature causes your
running container to rebuild itself automatically when you make changes to your
content files.

To stop the staging container, use the `docker compose down` command:
To stop the development container:

```bash
docker compose down
```
1. In your terminal, press `<Ctrl+C>` to exit the file watch mode of Compose.
2. Stop the Compose services with the `docker compose down` command.

### Build the docs with deployment features enabled

Expand Down Expand Up @@ -140,4 +137,4 @@ for your operating system. To enable the vale integration for your editor, insta

The vale rules that implement the Docker style guide are included in the Docker docs repository,
in the `.github/vale` directory. Vale will automatically apply these rules when invoked in this
repository.
repository.
2 changes: 1 addition & 1 deletion content/desktop/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ docker.io/molly/privateimage:latest

- [Explore Docker Desktop](use-desktop/index.md) and its features.
- Change your Docker Desktop settings
- [Browse common FAQs](faqs/general.md)
- [Browse common FAQs](faqs/general.md)

0 comments on commit c379bec

Please sign in to comment.