Skip to main content

Installation Guide - Docker

Analytics API: This service is an API that extracts data from the analytics database.

Prerequisites

  • Installation of Analytics Data Processing (v2.0.0 or greater)

Configuration options

The service should be configured with the following environment variables when the container is started:

Setting NameDescriptiondefault value
AUTHENTICATION__API_KEYThe API key set by the user during setup(empty)
AUTHENTICATION__API_KEY_HEADERHeader name containing the API key(empty)
DATABASE__TYPEType of database (use mssql)(empty)
DATABASE__USERNAMEUsername for database(empty)
DATABASE__PASSWORDPassword for database(empty)
DATABASE__HOSTHost for database(empty)
DATABASE__PORTPort for database(empty)
DATABASE__NAMEName of database(empty)
DATABASE__TRUST_SERVER_CERTIFICATETrust server certificate option yes or noyes
DATABASE__ENCRYPTEncryption option yes or noyes

Running the container

Use the following command to run the Analytics API container with the required configuration:

docker run -d \
--name analytics-api \
-p 9091:9091 \
-e AUTHENTICATION__API_KEY="your-secret-api-key" \
-e AUTHENTICATION__API_KEY_HEADER="X-API-Key" \
-e DATABASE__TYPE="mssql" \
-e DATABASE__USERNAME="your-db-username" \
-e DATABASE__PASSWORD="your-db-password" \
-e DATABASE__HOST="your-db-host" \
-e DATABASE__PORT="1433" \
-e DATABASE__NAME="analytics" \
-e DATABASE__TRUST_SERVER_CERTIFICATE="yes" \
-e DATABASE__ENCRYPT="yes" \
<image-name>:<tag>

Replace the placeholder values with your actual configuration details.