From d6ab7a54ff76c7c7b8d03a026af4c6c5b85104e9 Mon Sep 17 00:00:00 2001 From: Paul Walko Date: Sun, 29 Oct 2023 18:31:31 -0400 Subject: [PATCH] photoview --- lech/docker/photoview.sh | 46 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 lech/docker/photoview.sh diff --git a/lech/docker/photoview.sh b/lech/docker/photoview.sh new file mode 100755 index 0000000..ce21ca9 --- /dev/null +++ b/lech/docker/photoview.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +set -e + +up () { + # Exposed on port 80 in pew-net + docker run \ + --detach \ + --name photoview \ + --restart unless-stopped \ + --env PHOTOVIEW_DATABASE_DRIVER=mysql \ + --env PHOTOVIEW_MYSQL_URL=photoview:photoview@tcp\(pv-mariadb\)/photoview \ + --env PHOTOVIEW_LISTEN_IP=photoview \ + --env PHOTOVIEW_LISTEN_PORT=80 \ + --env PHOTOVIEW_MEDIA_CACHE=/app/cache \ + --volume /mammoth/photoview/cache:/cache:rw \ + --volume /mammoth/photos:/photos:ro \ + --network pew-net \ + viktorstrate/photoview:2 + + docker run \ + --detach \ + --name pv-mariadb \ + --restart unless-stopped \ + --env MYSQL_DATABASE=photoview \ + --env MYSQL_USER=photoview \ + --env MYSQL_PASSWORD=photoview \ + --env MYSQL_RANDOM_ROOT_PASSWORD=1 \ + --volume /mammoth/photoview/mysql:/var/lib/mysql:rw \ + --network pew-net \ + mariadb:10.5 +} + +down () { + docker stop photoview || true + docker stop pv-mariadb || true + docker rm photoview || true + docker rm pv-mariadb || true +} + +logs () { + docker logs --follow photoview + docker logs --follow pv-mariadb +} + +$@