diff mbox series

[layerindex-web,3/4] docker/settings.py: read more settings from the environment

Message ID 20261018214146.67856-4-tim.orling@konsulko.com
State New
Headers show
Series Docker: environment files for dev, staging and production | expand

Commit Message

Tim Orling Oct. 18, 2026, 9:41 p.m. UTC
Let DATABASE_PORT (default 3306) and STATIC_ROOT be overridden from the
environment, and add ENABLE_RRS: set it to 1 to add the 'rrs'
(Recipe Reporting System) app to INSTALLED_APPS. It is off by default.

AI-Generated: Claude Opus 5.5
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
 docker/settings.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/docker/settings.py b/docker/settings.py
index c33731c..820c4bb 100644
--- a/docker/settings.py
+++ b/docker/settings.py
@@ -22,7 +22,7 @@  DATABASES = {
         'USER': os.getenv('DATABASE_USER', 'root'),
         'PASSWORD': os.getenv('DATABASE_PASSWORD', 'testingpw'),
         'HOST': os.getenv('DATABASE_HOST', 'layersdb'),
-        'PORT': '',
+        'PORT': os.getenv('DATABASE_PORT', '3306'),
     }
 }
 
@@ -65,7 +65,7 @@  MEDIA_URL = ''
 # Don't put anything in this directory yourself; store your static files
 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
 # Example: "/home/media/media.lawrence.com/static/"
-STATIC_ROOT = '/usr/share/nginx/html/static/'
+STATIC_ROOT = os.getenv('STATIC_ROOT', '/usr/share/nginx/html/static/')
 
 # URL prefix for static files.
 # Example: "http://media.lawrence.com/static/"
@@ -164,6 +164,9 @@  INSTALLED_APPS = (
     'corsheaders',
 )
 
+if os.getenv('ENABLE_RRS', '0') == '1':
+    INSTALLED_APPS += ('rrs',)
+
 AUTHENTICATION_BACKENDS = [
     'axes.backends.AxesBackend',
     'django.contrib.auth.backends.ModelBackend',