From 2a12e374fee0708f762fcf874c478369b9dfbaa6 Mon Sep 17 00:00:00 2001 From: Patrick Valsecchi Date: Wed, 28 Sep 2016 07:53:53 +0200 Subject: [PATCH] Allow to tune the debug levels from the environment --- Dockerfile | 3 +++ README.md | 5 +++++ etc/apache2/conf-enabled/mapserver.conf | 3 +++ 3 files changed, 11 insertions(+) diff --git a/Dockerfile b/Dockerfile index 65dfbe5f..7475f952 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,6 +37,9 @@ EXPOSE 80 COPY . / +ENV MS_DEBUGLEVEL 0 +ENV MS_ERRORFILE stderr + ENTRYPOINT ["/docker-entrypoint.sh"] CMD ["apache2", "-DFOREGROUND"] diff --git a/README.md b/README.md index 15a1ac4f..b7ae732f 100644 --- a/README.md +++ b/README.md @@ -26,3 +26,8 @@ All the files ending with `.tmpl` in /etc/mapserver and /etc/apache2 (can be changed by defining CONFD_DIRS in one of the sourced files) will go though confd with the `env` backend. The TOML files are created automagically to create a file at the same location, with just the `.tmpl` extension removed. + +You can use the following environment variables (when starting the container) +to tune it: +* MS_DEBUGLEVEL: The debug level 0=off 5=verbose +* MS_ERRORFILE: If you want the debug to something other than STDOUT diff --git a/etc/apache2/conf-enabled/mapserver.conf b/etc/apache2/conf-enabled/mapserver.conf index 95d15953..f053177f 100644 --- a/etc/apache2/conf-enabled/mapserver.conf +++ b/etc/apache2/conf-enabled/mapserver.conf @@ -1,3 +1,6 @@ +FcgidInitialEnv MS_ERRORFILE ${MS_ERRORFILE} +FcgidInitialEnv MS_DEBUGLEVEL ${MS_DEBUGLEVEL} + ScriptAlias /mapserv /usr/lib/cgi-bin/mapserv ScriptAlias / /usr/lib/cgi-bin/mapserv