diff --git a/photoview/.env b/photoview/.env new file mode 100644 index 0000000..9e06ae4 --- /dev/null +++ b/photoview/.env @@ -0,0 +1,5 @@ +HOST_PHOTOVIEW_LOCATION="/root/photoview" +PHOTOVIEW_PORT="2283" +HOST_PHOTOVIEW_MEDIA_ROOT="/mnt/images" +PHOTOVIEW_DATABASE_DRIVER="sqlite" +PHOTOVIEW_SQLITE_PATH="/home/photoview/database/photoview.db" diff --git a/photoview/docker-compose.yml b/photoview/docker-compose.yml index 364e93f..32dcf37 100644 --- a/photoview/docker-compose.yml +++ b/photoview/docker-compose.yml @@ -26,33 +26,17 @@ services: - api_db_net ports: - "${PHOTOVIEW_PORT}:80" ## HTTP port (host:container) - ## Comment out the entire `depends_on` section if PHOTOVIEW_DATABASE_DRIVER is set to `sqlite` in the .env - # depends_on: - # photoview-prepare: - # condition: service_completed_successfully - # mariadb: - # condition: service_healthy - ## Security options for some restricted systems security_opt: - seccomp:unconfined - apparmor:unconfined environment: PHOTOVIEW_DATABASE_DRIVER: ${PHOTOVIEW_DATABASE_DRIVER} - ## Comment out the next variable in the case PHOTOVIEW_DATABASE_DRIVER is set to `sqlite` or `postgres` in the .env - PHOTOVIEW_MYSQL_URL: "${MARIADB_USER}:${MARIADB_PASSWORD}@tcp(photoview-mariadb)/${MARIADB_DATABASE}" - ## Uncomment the next line if PHOTOVIEW_DATABASE_DRIVER is set to `sqlite` in the .env - # PHOTOVIEW_SQLITE_PATH: ${PHOTOVIEW_SQLITE_PATH} - ## Uncomment the next variable if set in the `.env` file - # PHOTOVIEW_UI_ENDPOINTS: ${PHOTOVIEW_UI_ENDPOINTS} + PHOTOVIEW_SQLITE_PATH: ${PHOTOVIEW_SQLITE_PATH} PHOTOVIEW_LISTEN_IP: "0.0.0.0" - ## Optional: To enable map related features, you need to create a mapbox token. - ## A token can be generated for free here https://account.mapbox.com/access-tokens/ - ## It's a good idea to limit the scope of the token to your own domain, to prevent others from using it. MAPBOX_TOKEN: ${MAPBOX_TOKEN} volumes: - "/etc/localtime:/etc/localtime:ro" - "${HOST_PHOTOVIEW_LOCATION}/timezone.txt:/etc/timezone:ro" - ## Uncomment the next line if PHOTOVIEW_DATABASE_DRIVER is set to `sqlite` in the .env - "${HOST_PHOTOVIEW_LOCATION}/database:/home/photoview/database" - "${HOST_PHOTOVIEW_LOCATION}/storage:/home/photoview/media-cache" - "${HOST_PHOTOVIEW_MEDIA_ROOT}:/photos:ro" diff --git a/photoview/env b/photoview/env index 6d0617c..9e06ae4 100644 --- a/photoview/env +++ b/photoview/env @@ -2,3 +2,4 @@ HOST_PHOTOVIEW_LOCATION="/root/photoview" PHOTOVIEW_PORT="2283" HOST_PHOTOVIEW_MEDIA_ROOT="/mnt/images" PHOTOVIEW_DATABASE_DRIVER="sqlite" +PHOTOVIEW_SQLITE_PATH="/home/photoview/database/photoview.db" diff --git a/photoview/fix.sh b/photoview/fix.sh new file mode 100755 index 0000000..f60a548 --- /dev/null +++ b/photoview/fix.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +docker compose down + +msg() { + >&2 printf '[*] %s\n' "$*" +} + +dir=/mnt/images + +if umount "$dir" ; then + msg "unmounted $dir" +else + msg "failed to unmount $dir!" +fi + +if mount "$dir" ; then + msg "mounted $dir" +else + msg "failed to unmount $dir!" +fi + +docker compose pull +docker compose up -d +