Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
.. Configuration:
Configuration
=============
This chapter details how a running VS service can be configured. And what steps
are necessary to deploy the configuration.
Concepts
--------
This section explains the various kinds of configuration items and where to
apply them.
Docker Compose Settings
These configurations are altering the behavior of the stack itself and its
contained services. A complete reference of the configuration file structure
can be found in `Docker Compose documentation
<https://docs.docker.com/compose/compose-file/>`_.
Environment Variables
These variables are passed to their respective containers environment and
change the behavior of certain functionality. They can be declared in the
Docker Compose configuration file directly, but typically they are bundled by
field of interest and then placed into ``.env`` files and then passed to the
containers. So for example, there will be a ``<stack-name>_obs.env`` file
to store the access parameters for the object storage.
All those files are placed in the ``env/`` directory in the instances
directory.
Environment variables and ``.env`` files are passed to the services via the
``docker-compose.yml`` directives. The following example shows how to pass
``.env`` files and direct environment variables:
.. code-block:: yaml
services:
# ....
registrar:
env_file:
- env/stack.env
- env/stack_db.env
- env/stack_obs.env
- env/stack_redis.env
environment:
INSTANCE_ID: "prism-view-server_registrar"
INSTALL_DIR: "/var/www/pvs/dev/"
SCALEFACTOR: "1"
IN_MEMORY: "false"
INIT_SCRIPTS: "/configure.sh /init-db.sh"
# ...
The following ``.env`` files are typically used:
* ``<stack-name>.env``: The general ``.env`` file used for all services
* ``<stack-name>_db.env``: The database access credentials, for all services
interacting with the database.
* ``<stack-name>_django.env``: This env files defines the credentials for the
django admin user to be used with the admin GUI.
* ``<stack-name>_obs.env``: This contains access parameters for the object
storage(s).
* ``<stack-name>_preprocessor.env``: Preprocessor related environment
variables
* ``<stack-name>_redis.env``: Redis access credentials and queue names
.. Usually, it is not possible to override the values in running containers.
.. So whenever such a value is changed, the stack has to be re-deployed in
.. order to push the changes to the services.
Configuration Files
Such files are passed to the containers in a similar way as environment
variables, but usually contain more settings at once and are placed at a
specific path in the container at runtime.
Configuration files are passed into the containers using the ``configs``
section of the ``docker-compose.yaml`` file. The following example shows how
such a configuration file is defined and the used in a service:
.. code-block:: yaml
# ...
configs:
my-config:
file: ./config/example.cfg
# ...
services:
myservice:
# ...
configs:
- source: my-config
target: /example.cfg
The following configuration files are used throughout the VS:
* ``<stack-name>_init-db.sh``: This shell script files purpose is to set up
the EOxServer instance used by both the renderer and registrar.
* ``<stack-name>_index-dev.html``/``<stack-name>_index-ops.html``: The
clients main HTML page, containing various client settings. The ``dev`` one
is used for development only, whereas the ``ops`` one is used for operational
deployment.
* ``<stack-name>_mapcache-dev.xml``/``<stack-name>_mapcache-ops.xml``: The
configuration file for MapCache, the software powering the cache service.
Similarly to the client configuration files, the ``dev`` and ``ops`` files
used for development and operational usage respectively. Further
documentation can be found at `the official site
<https://mapserver.org/mapcache/config.html>`_.
https://gdal.org/user/configoptions.html