Advanced Configuration

Use a Custom Port

Expose the main application on a port other than the default port.

Steps:

  1. Update the port mapping -p <custom-port>:3000 parameter.

  2. Provide the following environment variable:

    -e GDCN_PUBLIC_URL=http://localhost:<custom-port>

Example: Change the port to the custom value of 3333 by running the following commands

Bash
PowerShell 7
docker run -i -t -e GDCN_PUBLIC_URL=http://localhost:3333 -p 3333:3000 -p 5432:5432 \
  -v gd-volume:/data gooddata/gooddata-cn-ce:2.1.0
docker run -i -t -e GDCN_PUBLIC_URL=http://localhost:3333 -p 3333:3000 -p 5432:5432 `
  -v gd-volume:/data gooddata/gooddata-cn-ce:2.1.0

Change Your Hostname

Use the GDCN_PUBLIC_URL environment variable to run your GoodData.CN Community Edition under a different hostname.

Let’s say you want your GoodData.CN Community Edition to be accessible under https://analytics.example.com/. All you need to do is to setup a reverse proxy (like Traefik or Nginx) in front of the docker container where your GoodData.CN Community Edition is deployed. It’s up to you to provide a valid TLS certificate for your public website, either by assigning certificate and key files, or by configuring an ACME Client in your reverse proxy.

Example:

The following example shows example integration with Traefik2, running on ports 80 and 443, while GoodData.CN Community Edition container runs on port 3000.

This is an example configuration for docker-compose to run GoodData.CN Community Edition with a custom hostname, with TLS terminated on Traefik and certificates provisioned by the Let’s Encrypt service. The certificate and key are stored in file acme.json located in docker volume traefik-data.

# docker-compose.yml
version: '3.7'

services:
  traefik:
    image: traefik:v2.5
    command:
      - --providers.docker=true
      - --entrypoints.web.address=:80
      - --entrypoints.web.http.redirections.entrypoint.to=websecure
      - --entrypoints.web.http.redirections.entrypoint.scheme=https
      - --entrypoints.websecure.address=:443
      # Set to your contact mail
      - --certificatesresolvers.le.acme.email=your.email@example.com
      - --certificatesresolvers.le.acme.storage=/etc/traefik/acme.json
      - --certificatesresolvers.le.acme.tlschallenge=true
      - --certificatesresolvers.le.acme.httpchallenge.entrypoint=web
    ports:
      - 80:80
      - 443:443
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      - "traefik-data:/etc/traefik"

  gooddata-cn-ce:
    image: gooddata/gooddata-cn-ce:latest
    environment:
      LICENSE_AND_PRIVACY_POLICY_ACCEPTED: "YES"
      GDCN_PUBLIC_URL: https://analytics.example.com
    ports:
      - 3000
    labels:
      - "traefik.http.routers.gooddata-cn-ce.rule=Host(`analytics.example.com`)"
      - "traefik.http.routers.gooddata-cn-ce.tls=true"
      - "traefik.http.routers.gooddata-cn-ce.tls.certresolver=le"
    volumes:
      - "gd-cn-data:/data:rw"

volumes:
  gd-cn-data:
  traefik-data:

Bypass CPU and Memory Check

At the very begining of container startup, GoodData.CN Community Edition tries to verify that the host has enough resources to reliably run all services it needs. On rare ocassions this check may fail and prevent the container from starting.

If you are sure that your computer satisfies the minimal HW requirements, you may bypass this check by setting environment variable GDCN_SKIP_RESOURCE_CHECK to value 1.

Change Default Bootstrap Token

GoodData.CN Community Edition comes with an initial, predefined bootstrap token that is used to access the API. The value of the bootstrap token is derived by encoding the <adminUser>:bootstrap:<adminPassword> string to Base64 format, see Create the Bootstrap Token for details.

You can modify the value of the bootstrap token by changing the <adminPassword> value that is set by the GDCN_TOKEN_SECRET environment variable:

Environment variableDefault valueNotes
GDCN_TOKEN_SECRETadmin123The value of the final token derived from admin:bootstrap:admin123 is YWRtaW46Ym9vdHN0cmFwOmFkbWluMTIz

Example: Run a GoodData.CN Community Edition container with a modified <adminPassword> part of the bootstrap token using the following command:

Bash
PowerShell 7
docker run -i -t -p 3000:3000 -p 5432:5432 -v gd-volume:/data \
  -e GDCN_TOKEN_SECRET=mySuperS3cr3t gooddata/gooddata-cn-ce:2.1.0
docker run -i -t -p 3000:3000 -p 5432:5432 -v gd-volume:/data `
  -e GDCN_TOKEN_SECRET=mySuperS3cr3t gooddata/gooddata-cn-ce:2.1.0

To find the value of your custom bootstrap token, convert the following string to Base64 format:

echo -n 'admin:bootstrap:mySuperS3cr3t' | base64

Your custom bootstrap token is YWRtaW46Ym9vdHN0cmFwOm15U3VwZXJTM2NyM3Q=.

Reconfigure Redis

GoodData.CN uses Redis for caching results. The default size of memory available to Redis instance is 256 MB. In case this value is not sufficient, or if you need to fine-tune Redis server, the following environment variables can help you:

Environment variableDefault valueNotes
GDCN_REDIS_MAXMEMORY256m
GDCN_REDIS_EXTRA_OPTIONSNoneThe following options are always present: --bind 127.0.0.1 --logfile "" --dir /data/redis --maxmemory "$GDCN_REDIS_MAXMEMORY" --maxmemory-policy allkeys-lru --rdbcompression yes --rdbchecksum yes

Example: Run a GoodData.CN Community Edition container with more Redis memory and with a more detailed logging option by running the following commands

Bash
PowerShell 7
docker run -i -t -p 3000:3000 -p 5432:5432 -v gd-volume:/data \
  -e GDCN_REDIS_MAXMEMORY=1gb -e GDCN_REDIS_EXTRA_OPTIONS="--loglevel verbose" gooddata/gooddata-cn-ce:2.1.0
docker run -i -t -p 3000:3000 -p 5432:5432 -v gd-volume:/data `
  -e GDCN_REDIS_MAXMEMORY=1gb -e GDCN_REDIS_EXTRA_OPTIONS="--loglevel verbose" gooddata/gooddata-cn-ce:2.1.0

Reconfigure PostgreSQL

GoodData.CN Community Edition uses a built-in instance of PostgreSQL 11 server. Configuration of this database server can be changed during the container startup using custom configuration snippets, bind-mounted from the docker host to path /etc/postgresql/11/main/conf.d/. You can either mount a single file, or the whole directory containing files with .conf extensions. These files are applied to PostgreSQL configuration in alphabetic order, in case of duplicate settings the last one wins.

Example: Run a GoodData.CN Community Edition container with customized PostgreSQL settings.

Let’s have a file called 99-custom.conf in your current directory where GoodData.CN Community Edition container is being started. It’s content is a regular PostgreSQL configuration file, containing for example:

shared_buffers = 300MB                  # min 128kB
temp_buffers = 16MB                     # min 800kB
work_mem = 10MB                         # min 64kB
maintenance_work_mem = 128MB            # min 1MB

Then you can bind-mount this file while running the container by running the following commands

Bash
PowerShell 7
docker run -i -t -p 3000:3000 -p 5432:5432 -v gd-volume:/data \
  -v $PWD/99-custom.conf:/etc/postgresql/11/main/conf.d/99-custom.conf \
  gooddata/gooddata-cn-ce:2.1.0
docker run -i -t -p 3000:3000 -p 5432:5432 -v gd-volume:/data `
  -v $PWD/99-custom.conf:/etc/postgresql/11/main/conf.d/99-custom.conf `
  gooddata/gooddata-cn-ce:2.1.0

Change the Logging Verbosity Level

Two environment variables can be passed through the docker command line to change the level of the log’s verbosity.

  • APP_LOGLEVEL - defines logging level for GoodData.CN components.
  • PULSAR_LOGLEVEL - defines logging level for Apache Pulsar.

Both these variables can contain one of ERROR, WARN, INFO, DEBUG or TRACE. The default is WARN.

Example: Run a GoodData.CN Community Edition container with increased application logging verbosity by running the following commands

Bash
PowerShell 7
docker run -i -t -p 3000:3000 -p 5432:5432 -v gd-volume:/data \
  -e APP_LOGLEVEL=INFO gooddata/gooddata-cn-ce:2.1.0
docker run -i -t -p 3000:3000 -p 5432:5432 -v gd-volume:/data `
  -e APP_LOGLEVEL=INFO gooddata/gooddata-cn-ce:2.1.0

Use Custom JDBC Drivers

Due to licensing restrictions, GoodData is not allowed to distribute the JDBC drivers for some databases. However, you can inject the drivers that we cannot distribute.

Use the following procedure to inject custom JDBC drivers into the Community Edition of GoodData.CN.

Steps:

  1. Download the driver to a local folder. For example, to /tmp/db-drivers/BIGQUERY.
  1. With the absolute path to db-drivers specified in the command line arguments, start the GoodData.CN Community Edition container using the following commands
Bash
PowerShell 7
docker run -i -t -p 3000:3000 -p 5432:5432 -v gd-volume:/data -v /tmp/db-drivers:/opt/extra-drivers \
  -e APP_LOGLEVEL=INFO gooddata/gooddata-cn-ce:2.1.0
docker run -i -t -p 3000:3000 -p 5432:5432 -v gd-volume:/data -v /tmp/db-drivers:/opt/extra-drivers `
  -e APP_LOGLEVEL=INFO gooddata/gooddata-cn-ce:2.1.0