[GH-ISSUE #114] Worker container config should use environment variables for DB #87

Closed
opened 2026-02-25 21:31:10 +03:00 by kerem · 6 comments
Owner

Originally created by @jessecureton on GitHub (Sep 7, 2020).
Original GitHub issue: https://github.com/ciur/papermerge/issues/114

The app production config uses environment variables for POSTGRES_HOST/POSTGRES_USER/etc. The worker production config uses static definitions for the DB connection.

The environment variables are very useful for running in container orchestration frameworks like Kubernetes or Nomad, and it would be great to not have to patch the worker container's production config at runtime.

Can the default worker config be updated to match the default app config & use the env variables?

Originally created by @jessecureton on GitHub (Sep 7, 2020). Original GitHub issue: https://github.com/ciur/papermerge/issues/114 The [app production config](https://github.com/ciur/papermerge/blob/master/docker/1.4/config/app.production.py) uses environment variables for `POSTGRES_HOST`/`POSTGRES_USER`/etc. The [worker production config](https://github.com/ciur/papermerge/blob/master/docker/1.4/config/worker.production.py) uses static definitions for the DB connection. The environment variables are very useful for running in container orchestration frameworks like Kubernetes or Nomad, and it would be great to not have to patch the worker container's production config at runtime. Can the default worker config be updated to match the default app config & use the env variables?
kerem 2026-02-25 21:31:10 +03:00
Author
Owner

@ciur commented on GitHub (Sep 8, 2020):

@jessecureton, sure ! It can :)
To be honest, I rarely use docker. But if you do this change, I will gladly accept your pull request! 😁

One remark though: if you decide to do the change, please do it in stable/1.4.x branch.

<!-- gh-comment-id:688900871 --> @ciur commented on GitHub (Sep 8, 2020): @jessecureton, sure ! It can :) To be honest, I rarely use docker. But if you do this change, I will gladly accept your pull request! :grin: One remark though: if you decide to do the change, please do it in stable/1.4.x branch.
Author
Owner

@jessecureton commented on GitHub (Sep 9, 2020):

Opened a PR against stable/1.4.x in #115. Let me know if there's anything you'd prefer to change :)

<!-- gh-comment-id:689260273 --> @jessecureton commented on GitHub (Sep 9, 2020): Opened a PR against stable/1.4.x in #115. Let me know if there's anything you'd prefer to change :)
Author
Owner

@ciur commented on GitHub (Sep 9, 2020):

@jessecureton I merged your pull request. Thank you!
Just now, after merge was complete, I thought that maybe your PR was work in progress... :)
If it is so, please, next time mark it with [WIP] prefix (work in progress).

Thank you for your contribution!

<!-- gh-comment-id:689317384 --> @ciur commented on GitHub (Sep 9, 2020): @jessecureton I merged your pull request. Thank you! Just now, after merge was complete, I thought that maybe your PR was work in progress... :) If it is so, please, next time mark it with [WIP] prefix (work in progress). Thank you for your contribution!
Author
Owner

@ciur commented on GitHub (Sep 10, 2020):

@jessecureton, your changes were added to master and 1.4.x branches.
1.4.3 release will be available next week (somewhere between 14-18 Sept 2020) so that you could test if the changes did the trick for you.
I rely on you, guys, to test docker part. As I mentioned above I don't use docker myself :)

<!-- gh-comment-id:690070866 --> @ciur commented on GitHub (Sep 10, 2020): @jessecureton, your changes were added to master and 1.4.x branches. 1.4.3 release will be available next week (somewhere between 14-18 Sept 2020) so that you could test if the changes did the trick for you. I rely on you, guys, to test docker part. As I mentioned above I don't use docker myself :)
Author
Owner

@jessecureton commented on GitHub (Sep 12, 2020):

Hi @ciur! Yes, I did a local build of the container with my changes and pushed it to a local docker repo. All seemed to work as expected. I will upgrade my deployment to 1.4.3 when it is available and report if there are any issues.

<!-- gh-comment-id:691492541 --> @jessecureton commented on GitHub (Sep 12, 2020): Hi @ciur! Yes, I did a local build of the container with my changes and pushed it to a local docker repo. All seemed to work as expected. I will upgrade my deployment to 1.4.3 when it is available and report if there are any issues.
Author
Owner

@ciur commented on GitHub (Sep 14, 2020):

great! thank you!

<!-- gh-comment-id:691810324 --> @ciur commented on GitHub (Sep 14, 2020): great! thank you!
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/papermerge#87
No description provided.