Possible to support docker subfolder mkdir, or parent volume map to /ps?

I’m hoping to be able to simplify my docker volume bind mounts. Let me iterate out three scenarios:

Scenario 1: Compose volume snippet below, and I run mkdir on the library, tmp, config, and logs folders before bringing the container up.

      - $MEDIADIR/photos:/photos
      - $DOCKERDIR/photostructure/library:/ps/library
      - $DOCKERDIR/photostructure/tmp:/ps/tmp
      - $DOCKERDIR/photostructure/config:/ps/config
      - $DOCKERDIR/photostructure/logs:/ps/logs

Everything works great and as intended, just like the instructions suggest. While there’s certainly nothing wrong with that, and it’s even ideal for people who may be putting the library or tmp folders in different locations, I’m wondering if it’s possible to keep it shorter.

Scenario 2: Do not pre-create the subfolders of tmp, library, config, and logs in the mapped photostructure folder, but I use the same volume snippet as above, I get the following:

Creating photostructure ... done
2021-06-23T23:13:59.289032548Z Error: code ENOENT: ENOENT: no such file or directory, open '/ps/config/PhotoStructure/settings.toml'
2021-06-23T23:13:59.289117763Z Error: ENOENT: no such file or directory, open '/ps/config/PhotoStructure/settings.toml'
2021-06-23T23:13:59.294037486Z {"fatal":true,"exit":true,"status":14,"pid":28,"ppid":21,"error":"main setup failed: Error: code ENOENT: ENOENT: no such file or directory, open '/ps/config/PhotoStructure/settings.toml'¹"}

Could the config directory (and possibly others) be created upon container startup?

Scenario 3: Shorten the volume bind mounts, and do not pre-create subfolders.

I’d like to change my volume mapping to the following.

      - $MEDIADIR/photos:/photos
      - $DOCKERDIR/photostructure:/ps

However, this results in the following error:

Creating photostructure ... done
2021-06-23T23:27:41.076308081Z [FATAL tini (7)] exec /ps/app/docker-entrypoint.sh failed: No such file or directory
2021-06-23T23:27:42.606503888Z [FATAL tini (7)] exec /ps/app/docker-entrypoint.sh failed: No such file or directory

Would it be possible to build an option to allow the /ps directory to be mounted directly, but perhaps utilize an environmental variable to have the /ps/app location not be bind mounted? Or is there a different way to simplify the bind mount folder structure under a config subdirectory of some kind, such that /ps/config was the parent for tmp, logs, config, and possibly library?

Thanks for your thoughts.

Thanks for sharing!

I agree, it’d be nice to only need 1 or 2 bind mounts.

I don’t want to break any current user’s containers, though.

I could default to placing logs, cache, and system config, if they’re missing, into
/ps/library/.photostructure/{logs,cache,system-config}. I’d just remove those as mountpoints in the dockerfile.

(This approach would avoid shenanigans is have to do with /ps/app if the user bind-mounted /ps).

That sounds like a good solution. Would that allow me to then only mount /ps/library theoretically, along with still specifying a separate originalsDir ? (in my case, /photos)

I’d prefer one mount for the library, and another mount for everything else. Could this be achieved without breaking existing installs by introducing a new setting for the “everything else” stuff?

I am personally not fond of the /ps/library/.photostructure folder to begin with. Ideally it’d reside outside of the library.

This is all quite configurable!

Look into the originalsDir setting.

1 Like

I see… So this would keep the .photostructure folder in the library path, but the actual picture would be somewhere else of my choosing. That sounds good! Next time I try to reinstall from scratch, I’ll try that!