#!/usr/bin/env bash # exit if a command fails set -o errexit # exit if required variables are not set set -o nounset # check for dependencies script_commands="docker" missing_counter=0 for needed_command in ${script_commands}; do if ! hash "${needed_command}" >/dev/null 2>&1; then printf "Command not found in PATH: %s\n" "${needed_command}" >&2 ((missing_counter++)) fi done if ((missing_counter > 0)); then printf "Minimum %d commands are missing in PATH, aborting.\n" "${missing_counter}" >&2 exit 1 fi # user to run as (should be able to write to the output directory) build_user="www-data" # input directory input_directory="/storage/photos/photography" # theme directory theme_directory="/storage/photos/theme-flow" # output directory output_directory="/var/www/html/pics.seedno.de" # gallery title gallery_title="Seednode's Photos" # run docker container docker run -i --rm \ -v "${input_directory}":/input:ro \ -v "${theme_directory}":/theme:ro \ -v "${output_directory}":/output \ -u "$(id -u "${build_user}")":"$(id -g "${build_user}")" \ thumbsupgallery/thumbsup thumbsup \ --input /input \ --output /output \ --theme-path /theme \ --title "${gallery_title}" \ --thumb-size "512" \ --large-size "4096" \ --photo-download "copy" \ --photo-preview "resize" \ --sort-albums-by "title" \ --sort-albums-direction "asc" \ --sort-media-by "date" \ --sort-media-direction "asc" \ --include-raw-photos true \ --cleanup true \ --embed-exif true \ --usage-stats false