CHAP, climate, and DHIS2
This page is the rest of the engine .env. It is not a second install. Use it while you are filling .env before the first start, or when the containers are already up and you are changing URLs. After a change, recreate the services that read the file.
The hostnames below must be reachable from the worker container. localhost inside that container is the worker itself.
Importing a climate dataset, and connecting another DHIS2 instance to pull data from, are operator tasks: Import climate data and Connect a source instance.
Before you start
Section titled “Before you start”- The
.envand Compose file from Deploy the engine. - A DHIS2 user the workers will use for imports. This account can differ from the person who installs the CAPS app.
- The CHAP base URL.
CHAP_BASE_URLis required and has no default. Without it the process does not listen.
Add these lines to the same .env:
# Reachable from the worker container, not from the operator laptop.DHIS2_BASE_URL=https://dhis2.example.orgDHIS2_USERNAME=caps-importDHIS2_PASSWORD=replace-me
CLIMATE_API_BASE_URL=https://climate-api.example.orgCLIMATE_DATA_BASE_URL=https://climate-data.example.org- DHIS2, as seen by workers.
DHIS2_BASE_URLis the instance workers call.DHIS2_USERNAMEandDHIS2_PASSWORDare the import account. - CHAP.
CHAP_BASE_URLis the CHAP HTTP API. SetCHAP_API_TOKENwhen that API reportsauth_required. Sharing CHAP’s Postgres and RabbitMQ is the other tab on the deploy page. It does not set this URL. - Climate service.
CLIMATE_API_BASE_URLis the climate HTTP API.CLIMATE_DATA_BASE_URLis the climate data service. Both must resolve from the worker network.
docker-compose.dev.yml in the caps-engine repository is a developer stack. It is not this install. Local development is the Development Guide.
If the containers are already running, recreate them so they read the new values:
docker compose -f compose.yml up -dUse both -f files when you started with the CHAP overlay.
Worker logs do not show a connection refused to the DHIS2 host, the CHAP host, or either climate host:
docker compose -f compose.yml logs worker-1GET /system/info can return 200 while "connected": false for one of those systems. The error string in that object names the failed call. Do not treat a 200 by itself as proof the workers can reach them.
If this fails
Section titled “If this fails”A URL that opens in your browser can still be unreachable from the worker. Use the hostname on the worker’s Docker network, or a DNS name that network can resolve. See Troubleshooting.