Introduction
Skedler Alerts is now available in the Docker Compose. It is a tool for defining and running multi-container (Skedler Alerts) Docker applications. With Compose, you use a YAML file to configure your application services. Then with a single command, you create and start all the services from your configuration.
Install Docker Compose (Note: docker-compose is not pre-installed with Docker on Linux)
Install docker-compose following the installation instructions that can be found here
Step-by-Step Instruction
Step 1: Define service in a Compose file:
Create a file called docker-compose.yml in your project directory and paste the following
docker-compose.yml:
version: '2.2' services: alerts: image: skedler/alerts:latest container_name: alerts privileged: true cap_add: - SYS_ADMIN volumes: - /sys/fs/cgroup:/sys/fs/cgroup:ro - alertdata:/data - ./alertconfig.yml:/opt/alert/config/alertconfig.yml command: opt/alert/bin/alert ports: - 3001:3001 networks: - skedlernet volumes: alertdata: driver: local networks: skedlernet:
This Compose file defines the service of Skedler Alerts.
Step 2: Basic Skedler configurations using alertconfig.yml
Create a files called alertconfig.yml in your project directory .
Getting the alertconfig.yml file found here
a) Configure Skedler Alerts Configuration like port, Elasticsearch URL and alert_index in alertconfig.yml
- port - The port in which Skedler Alerts runs. The default port is 3001
- elasticsearch_url - Elasticsearch URL with the port (even if the port is 80) in the following format <protocol>://<server>:<port>
- alert_index - Skedler Alerts index which will be created in Elasticsearch. It will create a new index if it doesn't already exist. Default alert_index is .alert
Note: For more configuration options kindly refer the article alertConfig.yml in Skedler Alerts Install Guide
Note: The following folders are persisted in the mapped volume (ie alertdata)
- Log files - log_dir: Persist log information in /data/log folder.
- Custom images, images and custom CSS - ui_files_location: Persist UI information in /data/uifiles folder
- alerts- alerts_dir: Persist generated alerts information in /data/alerts folder.
Step 3: Build and run your app with compose