Configuration #

Certain settings of the FLAT server can be configured using environment variables. The chapter Defining Environment Variables in the Cookbook provides information on how to set environment variables.

Environment Variables #

Setting environment variables is easy. Provide them directly in your docker compose configuration in the environment or the envfile sections:

services:
  flat:
    image: code-registry.avenga.cloud/product/flat/flat/flatrunner
    env_file: my.env
    environment:
      - MY_VAR=my value

General #

Request Timeouts #

Note that the maximum allowed overall time for a given request is always limited by FLAT_MAX_TIMEOUT. All other timeouts can be individually adjusted for each request using the appropriate request option.

Use the following environment variables to configure the timeouts used during requests:

php.ini #

Arbitrary directives can be merged into php.ini by setting environment variables starting with PHP_INI_. For example, to set post_max_size to 100 MiB, just export PHP_INI_post_max_size=100M in the environment of the flatrunner or flatphp container:

  environment:
    - PHP_INI_post_max_size=100M

Refer to the PHP documentation for a list of directives.

PHP-FPM #

Some parameters used for PHP-FPM process management can be adjusted using environment variables. Refer to the PHP-FPM documentation for more information.

httpd.conf #

Arbitrary directives can be merged into httpd.conf by setting environment variables starting with APACHE_. For example, to set Mutex posixsem, just include APACHE_Mutex=posixsem in the environment of the flatrunner or flatapache container:

  environment:
    - APACHE_Mutex=posixsem

Refer to the Apache HTTP Server documentation for the available directives.

If you want to set a directives more than once (e.g. to set multiple headers), you can append arbitrary strings to the variable name, separated with a _. Those suffixes, including the _ will be removed. For example: APACHE_Header_1='set MyHeader "foo"' and APACHE_Header_2='set MyOtherHeader "bar"' will produce two Header set ... directives.

For more complex configurations, such as <Location>-blocks, you will have to create a new container image and copy files containing those statements into the appropriate directories.

See also #