Using docker secrets

Would it be possible to implement using docker secrets.
For my setup (https://github.com/ksga/seafile_pro_docker/) it would be useful if the following could be specified using “_FILE”:
DB_ROOT_PASSWD
SEAFILE_ADMIN_EMAIL
SEAFILE_ADMIN_PASSWORD

Hi @daniel.pan it’s 2026 it’s time for docker secrets. :slight_smile:

It sounds like a solid idea to use Docker Secrets for things like DB passwords, especially for a production setup. One thing to keep in mind is that Seafile’s current Docker image doesn’t always natively look for the _FILE environment variable suffix that some official images use to read from /run/secrets/. As a workaround, you might need to use a custom entrypoint script or a small wrapper to read the secret file and export it as the environment variable Seafile expects before the main process starts. Alternatively, you can try mapping the secret file directly into the location where Seafile looks for its config files, though that can be a bit more finicky with permissions. It would definitely be a great addition to the official image if they added native support for secret files!

With only docker now this is very interesting, for _FILE is just a 15 line bash function inside the dockerfile, language agnostic.

This feature request is currently being tracked on GitHub: Support docker secrets · Issue #150 · haiwen/seafile-docker · GitHub

Your point about the implementation being a simple, language-agnostic bash function is very relevant. It might be helpful to share that specific perspective or a code snippet on the GitHub issue to help move the discussion forward.

Can I use this with seafile 13 and 12 also? I think so, because it is a docker feature, right?

Docker can mount secrets as files, but the Seafile image also needs to support reading those files. Docker support alone doesn’t confirm that the approach works with Seafile 12 or 13, and I can’t confirm compatibility with those versions.

The Seafile 14.0 manual documents a Docker Compose secrets approach to use after the initial deployment: Use Docker compose secrets - Seafile Admin Manual