Skip to content

Commit

Permalink
Add WORKDIR and CMD
Browse files Browse the repository at this point in the history
  • Loading branch information
leojonathanoh committed Nov 3, 2023
1 parent d0b471f commit c232892
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 3 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
3 changes: 2 additions & 1 deletion generate/templates/Dockerfile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
"@
8 changes: 8 additions & 0 deletions generate/templates/README.md.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
``````
"@

Expand Down
2 changes: 1 addition & 1 deletion generate/templates/docker-entrypoint.sh.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -eu
if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- pagefind "$@"
set -- pagefind_extended "$@"
fi
exec "$@"
Expand Down
2 changes: 2 additions & 0 deletions variants/1.0.3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
2 changes: 1 addition & 1 deletion variants/1.0.3/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- pagefind "$@"
set -- pagefind_extended "$@"
fi

exec "$@"

0 comments on commit c232892

Please sign in to comment.