Installation with Docker
Before you can run ApiOmat Analytics in Docker, you should see the requirements here.
Run ApiOmat Analytics
You now have 2 options running the container: you can either run the container via Docker Compose or via command line docker run. The following commands/configurations are only examples and can be adjusted to fit your needs.
Docker Run
The shown command will start the ApiOmat Analytics version 1.5.0 and map your config-files to the config-files in the container. It will also be reachable over localhost:8001.
docker run --name yourApiomatAnalyticsContainerName -d -p 8001:80 -e analytics_path='/analytics' -e analytics_aomDashboardUrl='http://my.apiomat.dashboard.url' apiomat/analytics:1.5.0Docker Compose
Using the following Docker Compose file will have the same configuration as the docker run command in the section above.
version: '3.5'services: aomanalytics: image: apiomat/analytics:1.5.0 user: root environment: analytics_path: /analytics analytics_aomDashboardUrl: http://my.apiomat.dashboard.url analytics_mongodb_host: mongo analytics_mongodb_port: 27017 ports: - 8001:80 depends_on: - mongo mongo: image: mongo:3.4
To run the container, you can simple use this command within the directory containing the docker-compose.yml from above:
docker-compose up -dAfter running those startup commands, it could take a while until ApiOmat Analytics is started and reachable. It is completely started when you reach the ApiOmat Analytics website with your browser (e.g. over localhost:8000).
Docker environment variables
|
variable |
description |
example |
|
analytics_path |
URL path extension for analytics |
/analytics |
|
analytics_aomDashboardUrl |
this is the public URL to your ApiOmat dashboard |
http://mydashboard.address.com |
|
analytics_mongodb_host |
use this, when having a single mongo instance, |
localhost |
|
analytics_mongodb_replSetServers |
use this and replicaName instead of "host" when configuring a mongo replicaset |
in docker compose: analytics_mongodb_replSetServers: - 192.168.3.1:27017 - 192.168.3.2:27017 |
|
analytics_mongodb_replicaName |
name of the replicaset |
test |
|
analytics_mongodb_db |
name of the db to use, |
countly |
|
analytics_mongodb_port |
mongodb port |
27017 |
|
analytics_mongodb_username |
if an authentication is configured for the mongodb, you have to set the username and password |
superadmin |
|
analytics_mongodb_password |
password of the mongodb authentication |
test123 |
|
analytics_mongodb_dbOptions_authSource |
having an authentication configured, this is the name if the database |
admin |
|
consul_host |
host address of consul |
127.0.0.1 |
|
consul_port |
port of consul |
8500 |
|
consul_healthCheck_hostname |
hostname of the analytics instance for consul to send health check requests |
http://locahost |
|
consul_healthCheck_port |
port of analytics instance |
80 |
|
consul_healthCheck_timeout |
timeout for the health check request (in seconds) |
2 |
|
consul_healthCheck_interval |
interval for health checks (in seconds) |
5 |
|
consul_healthCheck_deregistercriticalserviceafter |
deregister analytics from consul, when it's unhealthy (in seconds) |
60 |
|
graylog_host |
host of graylog |
locahost |
|
graylog_port |
port of graylog |
12201 |