From 19b56d37506bef772560251edd5ec1812a90ddb0 Mon Sep 17 00:00:00 2001 From: Maicol Battistini Date: Tue, 16 Jul 2024 20:59:00 +0200 Subject: [PATCH] feat: Added development server when the `DEVELOPMENT` env var is set Development server will restart when extensions files are changed --- compose/2.10/.ckan.env | 2 ++ images/ckan/2.10/setup/app/start_ckan.sh | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/compose/2.10/.ckan.env b/compose/2.10/.ckan.env index 4230d56..ca6058a 100644 --- a/compose/2.10/.ckan.env +++ b/compose/2.10/.ckan.env @@ -2,6 +2,8 @@ # Information about how it works: https://github.com/okfn/ckanext-envvars # Note that variables here take presedence over build/up time variables in .env +DEVELOPMENT=true + # Set to true to disable CKAN from starting and serve a maintenance page MAINTENANCE_MODE=false diff --git a/images/ckan/2.10/setup/app/start_ckan.sh b/images/ckan/2.10/setup/app/start_ckan.sh index 6fab855..a2e15ba 100755 --- a/images/ckan/2.10/setup/app/start_ckan.sh +++ b/images/ckan/2.10/setup/app/start_ckan.sh @@ -61,6 +61,13 @@ then done fi +# Enable development server if in development mode +echo "DEVELOPMENT MODE: $DEVELOPMENT" +if [ "$DEVELOPMENT" = true ]; then + echo "Starting development server" + ckan -c $APP_DIR/production.ini run -H 0.0.0.0 +fi + # Check whether http basic auth password protection is enabled and enable basicauth routing on uwsgi respecfully if [ $? -eq 0 ] then