Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scripts to run hugo in docker #23

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,11 @@ npm install
```

Then run the site using `npm run serve`. To have the site run locally with a functioning local search, run `npm run serve:with-pagefind`.

### To run in docker

As memtioned above, fork and clone this repository, run `git submodule`, then run following:

```bash
./run-hugo-in-docker.sh
```
11 changes: 11 additions & 0 deletions run-hugo-in-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

TODO_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

docker run -it --rm --name hugo-todo-glossary \
-v ${TODO_DIR}:/src/ \
-v ${TODO_DIR}/run-hugo.sh:/run-hugo.sh \
-w /src/ \
-p 1313:1313 \
eclipsefdn/hugo-node:h0.120.4-n18.19.1 \
/run-hugo.sh
8 changes: 8 additions & 0 deletions run-hugo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

mkdir /.npm
chown 1000:1000 /.npm
npm install

apt install gosu
gosu 1000 hugo serve --minify -DFE -w --bind 0.0.0.0