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.

Starting CIMonitor

CIMonitor needs three environment variables to connect to Firebase:

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

Prepend these environment variables before the command to start CIMonitor:

$ STORAGE_TYPE="firebase" \
    FIREBASE_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_TYPE="firebase" \
    -e FIREBASE_URL="" \
    -e FIREBASE_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_TYPE
      value: "firebase"
    - name: FIREBASE_URL
      value: ""
      value: "/etc/firebase-secrets/firebase-private-key.json"
    - name: firebase-secrets
      readOnly: true
      mountPath: "/etc/firebase-secrets"