diff --git a/README.md b/README.md index 2ad9c78..b7daa8e 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,14 @@ Dockerized [pagefind](https://github.com/CloudCannon/pagefind). |:-------:|:---------:| | `:1.0.3`, `:latest` | [View](variants/1.0.3) | +## Usage + +Mount the public directory into the container at /public. + +```sh +docker run --rm -it -v /path/to/public:/public docker-pagefind:1.0.3 --site public +``` + ## Development Requires Windows `powershell` or [`pwsh`](https://github.com/PowerShell/PowerShell). diff --git a/generate/templates/Dockerfile.ps1 b/generate/templates/Dockerfile.ps1 index ba76cce..99edfd8 100644 --- a/generate/templates/Dockerfile.ps1 +++ b/generate/templates/Dockerfile.ps1 @@ -15,6 +15,7 @@ RUN set -eux; \ COPY docker-entrypoint.sh /docker-entrypoint.sh RUN chmod +x docker-entrypoint.sh +WORKDIR / ENTRYPOINT [ "/docker-entrypoint.sh" ] - +CMD [ "pagefind_extended", "--site", "/public" ] "@ diff --git a/generate/templates/README.md.ps1 b/generate/templates/README.md.ps1 index f91883a..7369d2b 100644 --- a/generate/templates/README.md.ps1 +++ b/generate/templates/README.md.ps1 @@ -26,6 +26,14 @@ $( } }) -join '' ) +## Usage + +Mount the public directory into the container at `/public`. + +``````sh +docker run --rm -it -v /path/to/public:/public docker-pagefind:$( $VARIANTS | % { $_['tag'] } | Select-Object -First 1 ) --site public +`````` + "@ diff --git a/generate/templates/docker-entrypoint.sh.ps1 b/generate/templates/docker-entrypoint.sh.ps1 index b6198db..70fb5cc 100755 --- a/generate/templates/docker-entrypoint.sh.ps1 +++ b/generate/templates/docker-entrypoint.sh.ps1 @@ -3,7 +3,7 @@ set -eu if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then - set -- pagefind "$@" + set -- pagefind_extended "$@" fi exec "$@" diff --git a/variants/1.0.3/Dockerfile b/variants/1.0.3/Dockerfile index eace6b3..745616d 100644 --- a/variants/1.0.3/Dockerfile +++ b/variants/1.0.3/Dockerfile @@ -14,4 +14,6 @@ RUN set -eux; \ COPY docker-entrypoint.sh /docker-entrypoint.sh RUN chmod +x docker-entrypoint.sh +WORKDIR / ENTRYPOINT [ "/docker-entrypoint.sh" ] +CMD [ "pagefind_extended", "--site", "/public" ] \ No newline at end of file diff --git a/variants/1.0.3/docker-entrypoint.sh b/variants/1.0.3/docker-entrypoint.sh index ead079b..28d1942 100644 --- a/variants/1.0.3/docker-entrypoint.sh +++ b/variants/1.0.3/docker-entrypoint.sh @@ -2,7 +2,7 @@ set -eu if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then - set -- pagefind "$@" + set -- pagefind_extended "$@" fi exec "$@" \ No newline at end of file