rigon/photo-gallery

Docker Compose

r3l1990 opened this issue ยท 21 comments

Love the look and idea behind this.

Is there a docker compose file available for this?

rigon commented

Thank you so much!

There wasn't a docker compose file, but I was able to quickly write one, it is actually pretty simple: checkout the example.

If you could provide any additional feedback on the project, I would really appreciate! ๐Ÿ˜ƒ

Thank you so much - A lot of this is a little over my head but I will spin up an instance of this when home after work and let you know how I get on and report back if any issues.

rigon commented

Great, let me know if you need any help with it!

Span it up and it is working fine in most regards, I honestly love the fact it can play video that is not in h.264 format.

My folder structure is Year-Month-Day so most of my folders dont show any photos when I select them in the left hand pane, Is this normal behaviour?

I do have a couple of folders with just dumped photos and they display fine.

Is there a workaround to keep my file structure in place but be able to select a folder within a folder to view its contents or have I mucked something / not done something correctly to set it up?

Thanks Again

Just as an added thought maybe a button to switch beetwen show folders or show all in Year folder so you can switch photo views depending on what you are trying to do, find something specific from a certain date or just browse.

rigon commented

To play video, I just feed the browser straight up from the file, no transcoding in between. Being able to play it is up to the browser if supports the format. I have plans to fill the cases where the browser doesn't support, but it's a complex task and I'm leaving it for later.

Oh no the video side of things is perfect :) No issue at all its what I love about this.

My issue is I cannot actually see any of my photos that are in for example 2023's folder listed by month and then by date :)

My folder structure is Year-Month-Day so most of my folders dont show any photos when I select them in the left hand pane, Is this normal behaviour?

I do have a couple of folders with just dumped photos and they display fine.

Is there a workaround to keep my file structure in place but be able to select a folder within a folder to view its contents or have I mucked something / not done something correctly to set it up?

rigon commented

Regarding the folder structure, my ultimate goal is not forcing anyone in particular. Everyone has different opinions on how to organize their photos and I should respect that. However I started the project with the following assumption:

  1. only scans for folders (i.e. the albums) in the collection root
  2. only scans for photos the in the root of albums

Everything else that doesn't follow this structure doesn't show. It is a quite limiting and goes against the goals of the project, but it was working for me (most of the cases). And don't want you changing your stuff because this.

Recognizing this issue, I have been working lately on that: #17
It is already merged on master, but not yet released. For the release want to test a bit more and add a few more things.
You can give it a try now by using this docker image: rigon/photo-gallery:master

A few things to have in mind (and I haven't yet written anywhere else):

  • this project works best when you have a lot of albums
  • not so much if you a have a lot of photos per album, as it attempts to load all photos within at once
  • still doesn't perform too bad, I have an album with 20k+ photos and only takes 15s to load
  • I have plans to address this issue by loading the album in chunks and virtual scrolling

Thank you I will give this a try just now - I can just add ":Master" to the end of rigon/photo-gallery in the docker compose yes?

If above works I will let you know how I get on.

Thank You :)

So when trying to pull the master image, it seems to be automatically exiting itself and not starting.

Trying to use it with Docker Compose like so:

version: "3"

volumes:
photo-gallery_data:

services:
photo-gallery:
image: rigon/photo-gallery:master
volumes:
- photo-gallery_data:/thumbs
- /media/data/photos/:/photos/:ro
- /media/data/recent/:/recent/:rw
ports:
- 3080:3080
command:
- "-cname=Photos,path=/photos,thumbs=/thumbs"
- "-cname=Recent,path=/recent,thumbs=/thumbs"

rigon commented

The docker compose file looks fine.
Maybe is because or the image or the container already exists and doesn't create a new one. Try delete them before.
If you could provide more info with logs from the console, I can help you further.

OK I have found the below log in portainer - Not sure if this is the one that will help you or not:

2023/06/21 16:22:14 Collections: map[Photos:Photos (/photos) Recent:Recent (/recent)]
2023/06/21 16:22:14 Current DB version v5 is different than required v6
2023/06/21 16:22:14 Run command with option -r enabled to recreate cache DB

Thank you again.

rigon commented

Ah ok, that requires upgrading the cache DB. Change your docker compose to include the flag -r in your command:

    command:
      - "-r"
      - "-cname=Photos,path=/photos,thumbs=/thumbs"
      - "-cname=Recent,path=/recent,thumbs=/thumbs"

Checkout the Usage section for more info.

Thank you :)

It is perfect :)

Loads all photos or lets you select a specific folder - Love it.

Will do some more testing and then begin to rave to everyone and any one looking for a new self hosted photo viewer.

The loading is not to bad, I imagine once the thumbnails are cached loading should be even better.

This is brilliant.

rigon commented

Thanks a lot!๐Ÿ˜„

I find the option to select a specific folder cool too, only when you have many sub-folders it becomes messy...

Yeah, creating the thumbnails takes a long time, but once they are cached after the first time, it is pretty quick!
You can create the thumbnails upfront in background, when the server is initiated, by adding the flag -b in the command.

For my entire collection which is about 1TB, took more than 2 days to finish on my Raspberry PI 4.

Thanks I have just reset the stack with -b command, mines is running on a ubuntu VM, will let you know the size of my collection and how long it takes to complete once done.

Thanks again.

Edited - Spelling

190gb collection roughly 32000 files and the scan has taken about 17 hours, very snappy at loading photos now everything is cached.

Still seems to struggle with some video but like you say this will be down to the browser.

So far so good! Enjoying it may just replace photoview.

rigon commented

I'm really glad you found it useful. I will keep working on it to make it even better ๐Ÿ˜„

Yeah, I still haven't paid too much attention to videos, I'm focused on making the app more robust and working fast.

Its been good with no issues, this will be a popular one in future :)

Video support would top its favour I think but that could just be me being bias, a self hosted alternative with transcoding simialr to Plex or JF is a dream :D

rigon commented

I hope you're right!
Just released v1.4.0, you can switch back to latest docker image, i.e. remove :master.
Have fun ๐Ÿ˜œ