Add some environment variables

This commit is contained in:
Frederic Guillot 2016-02-28 12:14:37 -05:00
parent 8d71bbb122
commit 85d4833ce5
6 changed files with 32 additions and 4 deletions

View File

@ -2,7 +2,7 @@ expose_php = Off
error_reporting = E_ALL
display_errors = Off
log_errors = On
error_log = syslog
error_log = /dev/stderr
date.timezone = UTC
allow_url_fopen = On
post_max_size = 30M

View File

@ -5,6 +5,10 @@ daemonize = no
[www]
env[DATABASE_URL] = $DATABASE_URL
env[DEBUG] = $DEBUG
env[DEBUG_FILE] = $DEBUG_FILE
catch_workers_output = yes
user = nginx
group = nginx
listen.owner = nginx

View File

@ -1,8 +1,8 @@
<?php
// Enable/disable debug
defined('DEBUG') or define('DEBUG', false);
defined('DEBUG_FILE') or define('DEBUG_FILE', __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'data'.DIRECTORY_SEPARATOR.'debug.log');
defined('DEBUG') or define('DEBUG', getenv('DEBUG'));
defined('DEBUG_FILE') or define('DEBUG_FILE', getenv('DEBUG_FILE') ?: __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'data'.DIRECTORY_SEPARATOR.'debug.log');
// Plugin directory
defined('PLUGINS_DIR') or define('PLUGINS_DIR', __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'plugins');
@ -80,7 +80,7 @@ defined('ENABLE_HSTS') or define('ENABLE_HSTS', true);
defined('ENABLE_XFRAME') or define('ENABLE_XFRAME', true);
// Syslog
defined('ENABLE_SYSLOG') or define('ENABLE_SYSLOG', true);
defined('ENABLE_SYSLOG') or define('ENABLE_SYSLOG', getenv('ENABLE_SYSLOG'));
// Default files directory
defined('FILES_DIR') or define('FILES_DIR', 'data'.DIRECTORY_SEPARATOR.'files');

View File

@ -69,6 +69,18 @@ You can attach 2 volumes to your container:
Use the flag `-v` to mount a volume on the host machine like described in [official Docker documentation](https://docs.docker.com/engine/userguide/containers/dockervolumes/).
Upgrade your container
----------------------
- Pull the new image
- Remove the old container
- Restart a new container with the same volumes
Environment variables
---------------------
The list of environment variables is available on [this page](env.markdown).
Config files
------------

11
doc/env.markdown Normal file
View File

@ -0,0 +1,11 @@
Environment Variables
=====================
Environment variables maybe useful when Kanboard is deployed as container (Docker).
| Variable | Description |
|---------------|---------------------------------------------------------------------------------------------------------------------------------|
| DATABASE_URL | `[database type]://[username]:[password]@[host]:[port]/[database name]`, example: `postgres://foo:foo@myserver:5432/kanboard` |
| DEBUG | Enable/Disable debug mode |
| DEBUG_FILE | Debug file location, `DEBUG_FILE=php://stderr` |
| ENABLE_SYSLOG | Enable/Disable logging to Syslog: `ENABLE_SYSLOG=1` |

View File

@ -105,6 +105,7 @@ Technical details
- [Daily background job](cronjob.markdown)
- [Config file](config.markdown)
- [Environment variables](env.markdown)
- [Email configuration](email-configuration.markdown)
- [URL rewriting](nice-urls.markdown)