Environment Variables

Environment variables for running CHT Sync

There are two environment variable groups in the .env file (if using Docker Compose), or in the values.yaml file (if using Kubernetes). To successfully set up CHT Sync, it is important to understand the difference between them.

  1. POSTGRES_: Used by PostgreSQL to establish the PostgreSQL database to synchronize CouchDB data to. They define the schema and table names to store the CouchDB data, as well as where the tables and views for the models defined in CHT_PIPELINE_BRANCH_URL will be created.
  2. COUCHDB_: Used by CouchDB to define the CouchDB instance to sync with. With COUCHDB_DBS, we can specify a list of databases to sync.

All the variables in the .env file:

NameDefaultDescription
COMPOSE_PROJECT_NAMEpipeline(Optional) Docker Compose name
POSTGRES_USERpostgresUsername of the PostgreSQL database
POSTGRES_PASSWORDpostgresPassword of the PostgreSQL database
POSTGRES_DBcht_syncPostgreSQL database
POSTGRES_SCHEMAv1PostgreSQL schema
POSTGRES_TABLEcouchdbPostgreSQL table where the CouchDB data is copied
POSTGRES_HOSTpostgresPostgreSQL instance
POSTGRES_PORT5432PostgreSQL port
CHT_PIPELINE_BRANCH_URL"https://github.com/medic/cht-pipeline.git#main"cht-pipeline branch containing the dbt models
DATAEMON_INTERVAL5Interval (in minutes) for looking for new changes in the CouchDB data
COUCHDB_USERmedicUsername of the CouchDB instance
COUCHDB_PASSWORDpasswordPassword of the CouchDB instance
COUCHDB_DBS"medic"Comma separated list of databases to sync e.g "medic, medic_sentinel"
COUCHDB_HOSTcouchdbHost of the CouchDB instance
COUCHDB_PORT5984Port of the CouchDB instance
COUCHDB_SECUREfalseIs connection to CouchDB instance secure?