forked from google/docsy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Docker to run docsy user guide locally (google#1016)
Add support to run the docsy website server locally inside a container. With support for both `docker` and `docker-compose`. The folder is mounted as a shared volume, allowing changes to be picked up by the container. The `node_modules` folder is kept in a volume, to avoid surfacing those files in the host folder. The documentation explains how to run the container as the host user, so you don't end up with files like `package.json` and `.hugo-build.lock` owned by root on the host os. Co-authored-by: LisaFC <[email protected]>
- Loading branch information
Showing
3 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM klakegg/hugo:0.95.0-ext-alpine as docsy-user-guide | ||
|
||
RUN apk update | ||
RUN apk add git | ||
COPY package.json /app/docsy/userguide/ | ||
WORKDIR /app/docsy/userguide/ | ||
RUN npm install --production=false | ||
|
||
CMD ["serve", "--cleanDestinationDir", "--themesDir ../..", "--baseURL http://localhost:1313/", "--buildDrafts", "--buildFuture", "--disableFastRender", "--ignoreCache", "--watch"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
version: "3.3" | ||
|
||
services: | ||
|
||
site: | ||
image: docsy/user-guide | ||
build: | ||
context: . | ||
ports: | ||
- "1313:1313" | ||
user: "${DOCSY_USER}" | ||
volumes: | ||
- /app/docsy/userguide/node_modules | ||
- .:/app/docsy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters