[GH-ISSUE #326] How to provide database (postgres for me) password via Docker secrets? #168

Open
opened 2026-02-26 10:30:30 +03:00 by kerem · 6 comments
Owner

Originally created by @jeffrson on GitHub (Jan 15, 2021).
Original GitHub issue: https://github.com/ONLYOFFICE/Docker-DocumentServer/issues/326

Do you want to request a feature or report a bug?

Feature(?)

What is the current behavior?

No way according to Docker-DocumentServer docs.

What is the expected behavior?

Have a POSTGRESQL_SERVER_PASS_FILE variable that will be read upon initialization and the content of which should be used as db superuser password. There might be use for POSTGRESQL_SERVER_DB_NAME_FILE and POSTGRESQL_SERVER_USER_FILE as well.

Originally created by @jeffrson on GitHub (Jan 15, 2021). Original GitHub issue: https://github.com/ONLYOFFICE/Docker-DocumentServer/issues/326 **Do you want to request a *feature* or report a *bug*?** Feature(?) **What is the current behavior?** No way according to Docker-DocumentServer docs. **What is the expected behavior?** Have a POSTGRESQL_SERVER_PASS_FILE variable that will be read upon initialization and the content of which should be used as db superuser password. There might be use for POSTGRESQL_SERVER_DB_NAME_FILE and POSTGRESQL_SERVER_USER_FILE as well.
Author
Owner

@ShockwaveNN commented on GitHub (Jan 18, 2021):

@agolybev Please take a look and decide if we should implement it

<!-- gh-comment-id:762040917 --> @ShockwaveNN commented on GitHub (Jan 18, 2021): @agolybev Please take a look and decide if we should implement it
Author
Owner

@pengu-fr commented on GitHub (Apr 25, 2022):

We would need to use secrets files to load secret for DB password and JWT secret, so indeed, adding 2 more configuration variables : DB_PWD_FILE and JWT_SECRET_FILE

<!-- gh-comment-id:1108479898 --> @pengu-fr commented on GitHub (Apr 25, 2022): We would need to use secrets files to load secret for DB password and JWT secret, so indeed, adding 2 more configuration variables : DB_PWD_FILE and JWT_SECRET_FILE
Author
Owner

@cirune commented on GitHub (Jun 17, 2022):

I second this! It would be very helpful to be able to set the environment variables DB_NAME, DB_USER and DB_PWD via docker secrets. (DB_*_FILE:/run/secrets/*).

<!-- gh-comment-id:1159039693 --> @cirune commented on GitHub (Jun 17, 2022): I second this! It would be very helpful to be able to set the environment variables DB_NAME, DB_USER and DB_PWD via docker secrets. (DB_\*_FILE:/run/secrets/\*).
Author
Owner

@igwyd commented on GitHub (Jun 20, 2022):

Hello @jeffrson, sorry for the late reply.
I think it's a good idea, i created enhancement issue 57658 in our private issue tracker

<!-- gh-comment-id:1160297667 --> @igwyd commented on GitHub (Jun 20, 2022): Hello @jeffrson, sorry for the late reply. I think it's a good idea, i created enhancement issue 57658 in our private issue tracker
Author
Owner

@webysther commented on GitHub (Feb 25, 2026):

Hello @jeffrson, sorry for the late reply. I think it's a good idea, i created enhancement issue 57658 in our private issue tracker

My suggestion is to just reuse the postgres script based on de-facto pattern of *_FILE:

https://docs.docker.com/compose/how-tos/use-secrets/
https://hub.docker.com/_/postgres#docker-secrets
https://github.com/docker-library/postgres/blob/master/docker-entrypoint.sh?#L9-L25

<!-- gh-comment-id:3960403622 --> @webysther commented on GitHub (Feb 25, 2026): > Hello [@jeffrson](https://github.com/jeffrson), sorry for the late reply. I think it's a good idea, i created enhancement issue 57658 in our private issue tracker My suggestion is to just reuse the postgres script based on de-facto pattern of `*_FILE`: https://docs.docker.com/compose/how-tos/use-secrets/ https://hub.docker.com/_/postgres#docker-secrets https://github.com/docker-library/postgres/blob/master/docker-entrypoint.sh?#L9-L25
Author
Owner

@webysther commented on GitHub (Feb 25, 2026):

Actually this is already ready to go, just wait for accept: https://github.com/ONLYOFFICE/Docker-DocumentServer/pull/519

<!-- gh-comment-id:3960435556 --> @webysther commented on GitHub (Feb 25, 2026): Actually this is already ready to go, just wait for accept: https://github.com/ONLYOFFICE/Docker-DocumentServer/pull/519
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Docker-DocumentServer-ONLYOFFICE#168
No description provided.