Skip to main content

Docker Installation

This page installs Analytics Data Processing and Analytics API with Docker Compose, on Linux or Windows. It applies to all versions delivered as Docker images. Once Docker is installed, the setup is one folder with three files and a folder for logs, and one command starts everything.

Read Installation first: it lists what you need, and how settings, the first run and upgrades work.

1. Install Docker​

Linux​

Install Docker Engine and the Compose plugin by following Docker's guide for your distribution: Install Docker Engine.

Check that it works:

docker compose version

Windows​

Install Docker Desktop with the WSL 2 backend by following Docker's guide: Install Docker Desktop on Windows. During installation, keep Use WSL 2 instead of Hyper-V selected. The services run as Linux containers.

After installation, open PowerShell and check that it works:

docker compose version

To have the services start again after a server restart, enable Start Docker Desktop when you sign in in the Docker Desktop settings.

Log in to the image registry​

Log in once with the credentials you received from support:

docker login

2. Set up the services​

Create an empty folder, for example ewa_analytics, and add the three files below to it. The logs folder holds the log files from both services.

ewa_analytics/
├── docker-compose.ewa_analytics.yml
├── logs/
│ ├── data_processing.log
│ └── api.log
├── .env.data_processing
└── .env.api

Create the log folder from inside ewa_analytics:

mkdir logs

On Linux, the services run as user id 1000 and must be able to write to the log folder:

sudo chown -R 1000:1000 logs

On Windows with Docker Desktop, no extra step is needed.

docker-compose.ewa_analytics.yml​

The version of each service is set in its image line. Use the versions from Version Compatibility.

name: ewa_analytics

services:
data_processing:
image: bliksund/release-analytics-data-processing-ewa:x.y.z
env_file: .env.data_processing
restart: unless-stopped
volumes:
- ./logs:/app/logs

api:
image: bliksund/release-analytics-api-ewa:x.y.z
env_file: .env.api
restart: unless-stopped
ports:
# Only reachable from this server. Put a reverse proxy with HTTPS in front, see the FAQ.
- "127.0.0.1:9090:9090"
volumes:
- ./logs:/app/logs
depends_on:
- data_processing

Ports​

Analytics API listens on port 9090 inside the container. The ports line maps it to a port on the server, in the form "<address>:<server port>:9090". You can change the server port to any free port, for example "127.0.0.1:8080:9090". Do not change the last 9090.

If you change the server port, the API log still says it is running on port 9090. That is the port inside the container. Use the server port in your URLs and reverse proxy.

.env.data_processing​

Connection details for both databases. The values below are the minimum. All options are described in the configuration reference for your version, for example Analytics Data Processing v2.6.0.

# EWA database (read only)
SOURCE__DATABASE__TYPE=mssql
SOURCE__DATABASE__HOST=ewa-db.example.local
SOURCE__DATABASE__PORT=1433
SOURCE__DATABASE__NAME=ewa
SOURCE__DATABASE__USERNAME=analytics_reader
SOURCE__DATABASE__PASSWORD=change-me

# Analytics database
TARGET__DATABASE__TYPE=mssql
TARGET__DATABASE__HOST=analytics-db.example.local
TARGET__DATABASE__PORT=1433
TARGET__DATABASE__NAME=analytics
TARGET__DATABASE__USERNAME=analytics_writer
TARGET__DATABASE__PASSWORD=change-me

# Run every 60 minutes
BLIKSUND_RUN_SCHEDULED=true
BLIKSUND_RUN_SCHEDULED_FREQUENCY_MIN=60
BLIKSUND_LOAD_BATCH_SIZE=50000

LOG__FILE__FILENAME="data_processing.log"
# No metrics collector: turn off metrics export
OTEL_METRICS_EXPORTER=none

.env.api​

Connection details for the Analytics database, and the API key your integrations will use. All options are described in the configuration reference for your version, for example Analytics API v1.4.13.

# Analytics database (read only)
DATABASE__HOST=analytics-db.example.local
DATABASE__PORT=1433
DATABASE__NAME=analytics
DATABASE__USERNAME=analytics_reader
DATABASE__PASSWORD=change-me

# Every request must send this header and key
AUTHENTICATION__API_KEY=choose-a-long-random-key
AUTHENTICATION__API_KEY_HEADER=BLIKSUND-X-API-KEY

LOG__FILE__FILENAME="api.log"

# No metrics collector: turn off metrics export
OTEL_METRICS_EXPORTER=none

Keep the .env files private: they contain passwords and the API key.

Set OTEL_METRICS_EXPORTER=none in both .env files unless you collect metrics with an OpenTelemetry collector. Without it, the logs repeat Failed to export metrics to localhost:4317 and OTLP telemetry endpoint unreachable. The services work either way.

Note that the services always logs in UTC.

3. Start the services​

From the folder with the files, run:

docker compose -f docker-compose.ewa_analytics.yml up -d

Check that both services are running, and follow the logs. The same logs are written to files in the logs folder.

docker compose -f docker-compose.ewa_analytics.yml ps
docker compose -f docker-compose.ewa_analytics.yml logs -f

Restarting​

Recreate the containers, so they read the .env files again. docker compose restart keeps the old settings.

docker compose -f docker-compose.ewa_analytics.yml up -d --force-recreate            # both services
docker compose -f docker-compose.ewa_analytics.yml up -d --force-recreate api # only Analytics API
docker compose -f docker-compose.ewa_analytics.yml up -d --force-recreate data_processing

First run​

See First run. To see how many runs have finished:

docker compose -f docker-compose.ewa_analytics.yml logs data_processing | grep "Transformer completed!"

On Windows, use PowerShell:

docker compose -f docker-compose.ewa_analytics.yml logs data_processing | Select-String "Transformer completed!"

Each finished run adds one line. No lines means the first run is still in progress.

4. Upgrade​

See Upgrading for the steps. To install a new version with Docker:

  1. Edit the image lines in docker-compose.ewa_analytics.yml, for example:

    image: bliksund/release-analytics-data-processing-ewa:2.6.0
  2. Download the new images and start them:

    docker compose -f docker-compose.ewa_analytics.yml pull
    docker compose -f docker-compose.ewa_analytics.yml up -d

To go back to the previous version, change the image lines back and run step 2 again.