CHT Core Framework > Overview > CHT Core
The different pieces of a CHT project, how they interact, and what they’re used for
This guide will walk you through setting up a deployment of CHT Sync with the CHT using Docker. This path is recommended if you host the CHT with Docker.
docker
or current version of Docker Desktop both of which include docker compose
. Note that the older docker-compose
is no longer supported.git clone https://github.com/medic/cht-sync
).In the cht-sync
folder, copy the values from the env.template
file to a .env
file. For more information, see the references on the Environment variables page.
For production CHT Core deployments, the port will most likely need to be set to 443
like this: COUCHDB_PORT=443
. This is because CHT Core uses an nginx
reverse proxy on port 443
, instead of the default 5984
port used in a stand-alone CouchDB instance which the env.template
has.
#8 DONE 0.0s
and you are returned to the command line. Be patient!This setup involves starting couch2pg, PostgreSQL, pgAdmin and dbt. It assumes you have a CouchDB instance running, and you updated the .env
CouchDB variables accordingly.
Run the Docker containers locally and wait for every container to be up and running:
docker compose -f docker-compose.postgres.yml -f docker-compose.yml up -d
You can verify this command worked by running docker ps
. It should show 4 containers running including couch2pg, dbt, PostgreSQL, and pgAdmin.
This local setup involves starting couch2pg and dbt. It assumes that CouchDB and PostgreSQL instances are run separately from the Docker Compose provided with CHT Sync, and the .env
variables were updated to match those instances details.
Run the Docker containers locally and wait for every container to be up and running:
docker compose -f docker-compose.yml up -d
You can verify this command worked by running docker ps
. It should show 2 containers running: couch2pg and dbt.
When you are done using the services, you can clean everything by running down
.
For example, in the scenario of separate couchdb instance, the command should look like:
docker compose -f docker-compose.postgres.yml -f docker-compose.yml down
To remove all the data volumes, add -v
at the end of this command.
The different pieces of a CHT project, how they interact, and what they’re used for
Data synchronization tools to enable analytics
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.