waschinski / photo-stream

Self-hosted, super simple photo stream
https://github.com/waschinski/photo-stream
MIT License
448 stars 68 forks source link

All photos regenerated every time container restarts #88

Open lanerussell opened 9 months ago

lanerussell commented 9 months ago

Is this behaviour intended? I can understand the site being regenerated, but it seems that all photos are resized into thumbnail, tint, and large every time the container restarts. With my small collection of ~160 photos, this takes over 20 minutes, during which time the site is totally down.

Configuration file: /photo-stream/_config.yml
            Source: /photo-stream
       Destination: /photo-stream/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
                    done in 1255.925 seconds.
 Auto-regeneration: enabled for '/photo-stream'
    Server address: http://0.0.0.0:4000
  Server running... press ctrl-c to stop.

I'm running the site in docker-compose, and am using volumes to keep a persistent copy of the site:

  photostream:
    image: waschinski/photo-stream:latest
    container_name: photostream
    volumes:
      - /opt/docker/photostream/photos:/photo-stream/photos
      - /opt/docker/photostream/.env:/photo-stream/.env
      - /opt/docker/photostream/config.yml:/photo-stream/_config.yml
      - /opt/docker/photostream/_site:/photo-stream/_site
    restart: always
    ports:
      - 4000:4000
hunsbct commented 9 months ago

I'm experiencing this as well, even with a persistent copy of the entire /photo-stream folder.

Morveus commented 8 months ago

Same here. Interested in following this issue.

I've tried changing a few lines in https://github.com/benubois/jekyll_image_processing without much effort and rebuilding from there, but without success. I'm not sure whether the issue lies within this resource or photo-stream.

garrywashere commented 4 months ago

Experiencing this as well. Takes well over an hour to generate, and photos/large, photos/thumbnails etc. are not even created.

Even if you manually create the folders and set permissions to 777, nothing is put into the folders and with each restart of the containers all the photos are regenerated for a stupidly long time.

waschinski commented 3 months ago

Hey guys, may I ask you go give this experimental feature a go? https://jekyllrb.com/docs/configuration/incremental-regeneration/

Basically just add incremental: true in your _config.yml file.

My results so far have been reducing generation time from 20 seconds to 6 seconds on subsequent starts with no modifications on the image folder.

I am still going to debug if some of my changes are causing some extra iterations over images or something but I am not very experienced with Ruby and Jekyll to be honest.

waschinski commented 3 months ago

One more thing to add to the initial question: yes, I think the behavior is intended. Generating the photos is part of the Jekyll build process which is always being triggered via the serve command. There is a --skip-initial-build option though which will "skip the initial site build which occurs before the server is started".

This actually looks like the behavior you would expect, but what about the first time starting photo-stream? You would have to manually build the page because the _site folder should be empty anyway (also as per default this is not persisted).