Initial commit of new flow

This commit is contained in:
Smaug123
2023-09-10 21:21:51 +01:00
commit a1072f203d
28 changed files with 701 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
FROM alpine:3.15.4
RUN apk add --no-cache imagemagick=7.1.0.16-r0
COPY "build.sh" "/build.sh"
RUN chmod +x /build.sh && \
mkdir /sentinels && \
chmod a+rwx /sentinels && \
addgroup -S pictures && adduser -S pictures -G pictures
USER pictures
WORKDIR /home/pictures
ENTRYPOINT []

13
docker/pictures/build.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/sh
TO_SCAN="$1"
SHELL="/bin/sh"
# For some reason, using $0 instead of `sh` makes Shellcheck warn about the single-quotes not expanding expressions
# shellcheck disable=SC2016
find "$TO_SCAN" -type f ! -name '*-thumb.jpg' -name '*.jpg' -exec "$SHELL" -c '
if [ -f "${@%.*}-thumb.jpg" ]; then exit 0; fi;
echo "$@"
convert "$@" -thumbnail 100x100^ -gravity center -extent 100x100 "${1%.*}-thumb.jpg"
' -- {} \; || exit 1