Skip to content

Commit

Permalink
Add settings script for production
Browse files Browse the repository at this point in the history
  • Loading branch information
pchoisel committed Nov 20, 2024
1 parent ee2d657 commit 1842854
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
25 changes: 25 additions & 0 deletions devops/girder/provision-prod.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import os

from girder.models.setting import Setting

if __name__ == "__main__":
# Set various settings through env variables.
# If the associated env variable does not exist. Use Girder's default
Setting().set("worker.api_url", os.environ.get(
"GIRDER_WORKER_API_URL", "http://girder:8080/api/v1"))
Setting().set("worker.broker", os.environ.get(
"GIRDER_WORKER_BROKER", "amqp://guest:guest@localhost/"))
Setting().set("worker.api_url", os.environ.get(
"GIRDER_WORKER_BACKEND", "rpc://guest:guest@localhost/"))
Setting().set("core.email_from_address", os.environ.get(
"GIRDER_EMAIL_FROM", "Girder <[email protected]>"))
Setting().set("core.smtp.encryption", os.environ.get(
"GIRDER_SMTP_ENCRYPTION", "none"))
Setting().set("core.smtp_host", os.environ.get(
"GIRDER_SMTP_HOST", "localhost"))
Setting().set("core.smtp.password", os.environ.get(
"GIRDER_SMTP_PASSWORD", ""))
Setting().set("core.smtp.port", os.environ.get(
"GIRDER_SMTP_PORT", "25"))
Setting().set("core.smtp.username", os.environ.get(
"GIRDER_SMTP_USERNAME", ""))
2 changes: 1 addition & 1 deletion docker-compose-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:
build:
context: ./devops/girder
privileged: true
command: -c "python3 /src/provision.py && girder mount /mnt/fuse && girder serve"
command: -c "python3 /src/provision.py && python3 /src/provision-prod.py && girder mount /mnt/fuse && girder serve"
ports:
- "${GIRDER_PORT-8080}:8080"
links:
Expand Down

0 comments on commit 1842854

Please sign in to comment.