From 894c107e22167fef532f4c6525ddcc062e4ffe59 Mon Sep 17 00:00:00 2001 From: wvr Date: Sat, 28 Feb 2026 07:07:53 -0600 Subject: [PATCH] photoview --- photoview/docker-compose.yml | 66 ++++++++++++++++++++++++++++++++++++ photoview/env | 4 +++ photoview/timezone.txt | 1 + 3 files changed, 71 insertions(+) create mode 100644 photoview/docker-compose.yml create mode 100644 photoview/env create mode 100644 photoview/timezone.txt diff --git a/photoview/docker-compose.yml b/photoview/docker-compose.yml new file mode 100644 index 0000000..364e93f --- /dev/null +++ b/photoview/docker-compose.yml @@ -0,0 +1,66 @@ +services: + ## Makes sure that the media cache folder is created with the correct permissions + photoview-prepare: + image: photoview/photoview:latest + hostname: photoview-prepare + container_name: photoview-prepare + network_mode: "none" + user: root + entrypoint: [] + command: /bin/bash -c "sleep 1 && chown -R photoview:photoview /home/photoview/media-cache" + cap_add: + - CHOWN + volumes: + - "/etc/localtime:/etc/localtime:ro" + - "${HOST_PHOTOVIEW_LOCATION}/timezone.txt:/etc/timezone:ro" + - "${HOST_PHOTOVIEW_LOCATION}/storage:/home/photoview/media-cache" + + photoview: + image: photoview/photoview:latest + hostname: photoview + container_name: photoview + restart: unless-stopped + stop_grace_period: 10s + networks: + - ui_net + - 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_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" + +networks: + ui_net: + driver: bridge + + api_db_net: + internal: true + diff --git a/photoview/env b/photoview/env new file mode 100644 index 0000000..6d0617c --- /dev/null +++ b/photoview/env @@ -0,0 +1,4 @@ +HOST_PHOTOVIEW_LOCATION="/root/photoview" +PHOTOVIEW_PORT="2283" +HOST_PHOTOVIEW_MEDIA_ROOT="/mnt/images" +PHOTOVIEW_DATABASE_DRIVER="sqlite" diff --git a/photoview/timezone.txt b/photoview/timezone.txt new file mode 100644 index 0000000..c7aac92 --- /dev/null +++ b/photoview/timezone.txt @@ -0,0 +1 @@ +America/Chicago