Repository with configuration files required for Containers Health Monitor Production Deployment using Docker Swarm.
- Simplified and automated startup through scripts.
- Linux (Ubuntu 16.04+ recommended)
- Docker Engine 18.06.0+
- Follow all the steps present in the official documentation.
- Docker Compose 1.22.0+
- Follow all the steps present in the official documentation.
- Make sure that Swarm is enabled by typing
docker system info
, and looking for a messageSwarm: active
(you might have to scroll up a little).- If Swarm isn’t running, simply type
docker swarm init
at a shell prompt to set it up.
- If Swarm isn’t running, simply type
To ensure flexibility, the health monitor services receive some parameters through environment variables, e.g. SMTP configurations, credentials (username and password), etc.
First, create the configuration file based on the .env.monitor.example
file:
$ cp .env.monitor.example .env.monitor
After making the settings, execute the command to assign the values defined in the environment variables that are in the settings file:
$ set -a && source .env.monitor && set +a
Variables to define the administrator user's credentials the first time the Grafana is instantiated.
Variable | Description | Example |
---|---|---|
ADMIN_USERNAME |
Username of the default admin user created automatically at the first time the Grafana is instantiated. | admin |
ADMIN_PASSWORD |
Password of the default admin user created automatically at the first time the Grafana is instantiated. | admin |
Variable | Description | Example |
---|---|---|
GF_PORT |
Port used by the Grafana service to listen for HTTP request. | 3000 |
Variable | Description | Example |
---|---|---|
GF_SMTP_ENABLED |
Enable SMTP server settings. | false |
GF_SMTP_HOST |
Host where the SMTP server is allocated. | smtp.gmail.com:465 |
GF_SMTP_USER |
Registered email on the SMTP server. It will be used to send emals when an alarm is detected. | [email protected] |
GF_SMTP_PASSWORD |
Password for the email registered on the SMTP server. | secret |
Variable | Description | Example |
---|---|---|
DATA_RETENTION |
Time the data remained stored in database. | 15d - corresponds to 15 days |
$ docker stack deploy -c docker-monitor-stack.yml <stack_name>
$ docker stack rm <stack_name>