diff options
| author | Paul Buetow <paul@buetow.org> | 2026-06-21 23:17:23 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-06-21 23:17:23 +0300 |
| commit | 79d78a296d2919155fe4d4bb2fac73d2fa7adeec (patch) | |
| tree | 64c4fb54f279a2b26e869680bb8bfa93fe132754 | |
| parent | ed549aaa423f10d15171c678303fea679d997220 (diff) | |
Add Docker image support
| -rw-r--r-- | .dockerignore | 5 | ||||
| -rw-r--r-- | Dockerfile | 26 | ||||
| -rw-r--r-- | docs/installation.md | 33 |
3 files changed, 63 insertions, 1 deletions
diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..f28c0fc --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +.git +.shuriken.*.backup.* +.shuriken.*.staging.* +cache +dist diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..92b33cf --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +FROM alpine:latest + +RUN apk add --no-cache \ + bash \ + coreutils \ + findutils \ + gawk \ + grep \ + imagemagick \ + rsync \ + sed \ + tar + +RUN install -d /etc/default /usr/share/shuriken + +COPY bin/shuriken /usr/bin/shuriken +COPY share/templates /usr/share/shuriken/templates +COPY assets/site /usr/share/shuriken/assets +COPY src/shuriken.default.conf /etc/default/shuriken + +RUN chmod 0755 /usr/bin/shuriken + +WORKDIR /work +VOLUME ["/work"] +ENTRYPOINT ["shuriken"] +CMD ["--generate"] diff --git a/docs/installation.md b/docs/installation.md index 60c8859..cae4077 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -55,4 +55,35 @@ source of truth is `src/shuriken.sh` rendered through the `VERSION` and You can run `./bin/shuriken` directly from a source checkout. The stock default template directory resolves to the installed location when it exists, and otherwise falls back to the source tree's `share/templates/default`. Likewise -the bundled favicon falls back to `assets/site/favicon.ico`.
\ No newline at end of file +the bundled favicon falls back to `assets/site/favicon.ico`. + +## Docker image + +Build the Alpine-based image from the source checkout: + +```sh +docker build -t shuriken . +``` + +Run it with an album project mounted as `/work`. The default container command +is `shuriken --generate`, so a directory containing `shuriken.conf`, +`INCOMING_DIR`, and `DIST_DIR` can be generated with: + +```sh +docker run --rm \ + --user "$(id -u):$(id -g)" \ + -v "$PWD:/work" \ + shuriken +``` + +Pass the normal shuriken CLI arguments after the image name: + +```sh +docker run --rm \ + --user "$(id -u):$(id -g)" \ + -v "$PWD:/work" \ + shuriken --generate --incoming ./photos --dist ./dist +``` + +Use `--user` when bind-mounting a host directory so generated files are owned by +the calling user instead of root. |
