As an alternative storage to the local filesystem, Google Firebase can be used.

When Firebase is used, both the config and the CI statuses are stored in Firebase, so no local storage is needed. This makes it possible to run the container on e.g. Kubernetes without losing state when upgrading or moving CIMonitor.

Creating a database

Log in on the Google Firebase console, and create a database by clicking on New Project. Make sure to use the Realtime Database option instead of Cloud Firestore.

Generating a private key

  1. On the project overview, go to the cogwheel > Project settings > Service accounts.
  2. Click Generate new private key, a JSON file will be downloaded.
  3. Store this JSON file somewhere logical on your local machine, you need it later.

Loading the config file

  1. Go back to the database view of the realtime database, and on the root node click the + sign.
  2. Create a node called config with a random value, then click on the config node.
  3. Now click the dots menu > Import JSON, and pick the config.json file created earlier.

The final result should look something like this:

imported firebase config

Starting CIMonitor

CIMonitor needs three environment variables to connect to Firebase:

environment variable description
STORAGE Set this to firebase to make use of Firebase.
FIREBASE_URL This url can be found above the database view in Firebase.
FIREBASE_PRIVATE_KEY_FILE The location of the downloaded private key JSON file.

Prepend these environment variables before the command to start CIMonitor:

$ STORAGE="firebase" \
    FIREBASE_PRIVATE_KEY_FILE="/path/to/firebase-private-key.json" \

Running the Docker container via Docker run

Simply pass on the environment variables to the docker container, like so:

$ docker run --name=cimonitor -d \
    -e STORAGE="firebase" \
    -e FIREBASE_URL="" \
    -e FIREBASE_PRIVATE_KEY_FILE="/path/to/firebase-private-key.json" \

or pass them via your docker-compose.yml file.

Running the Docker container on Kubernetes

When running CIMonitor on Kubernetes, a secret can be created:

$ kubectl create secret generic firebase-secrets \

This secret can then be mounted inside the container:

kind: Pod
apiVersion: v1
  name: cimonitor
    name: cimonitor-prod
  - name: firebase-secrets
      secretName: firebase-secrets
  - name: server
    image: cimonitor/server:latest
    - name: STORAGE
      value: "firebase"
    - name: FIREBASE_URL
      value: ""
      value: "/etc/firebase-secrets/firebase-private-key.json"
    - name: firebase-secrets
      readOnly: true
      mountPath: "/etc/firebase-secrets"