CHT Docker Helper: The Fastest App Development Setup

Most folks today run docker-compose up and see this when they’re done:

Along the top we see a terminal with the raw logs of both haproxy and medic_os docker containers. Potentially there may be an error hiding in here, but it’s had to tell. Along the bottom we’ve browsed to https://localhost, but there’s a scary warning because the CHT instance doesn’t have a valid TLS certificate. While a savvy developer knows their way around this setup, it can be intimidating for first time app developers or folks looking to take the CHT for a quick spin locally. Further, you can not connect your mobile device to this instance without some extra effort (mainly this script or this extra container - both are great!)

We think most folks would prefer to run ./cht-docker-compose.sh -e /env and see this when they’re done:

The CHT Docker Helper does the same thing that docker-compose does, literally using the exact same command line calls. However, it tries multiple times to recover from errors, allows you to easily stop and start different instances (even run concurrent instances!) and gives you a simple text based interface showing the status along the way. When it has succeeded in starting, it shows the https:// enabled URL of the CHT. With a valid TLS certificate installed, this instance is ready for mobile testing with CHT Android. The Fauxton URL for CouchDB access is listed as well.

The Helper was developed on Linux, but has been tested to work on Windows and x86 based macOS computers (We’re still working on M1 support). Please see the troubleshooting section if you get stuck - or post a question here on the forums!

While this post might be more at home in the “Technical Support” section, I’m hoping to reach a more broad audience of anyone looking to run a local instance of the CHT for both app development and app testing.

5 Likes

Thanks @mrjones, this surely simplifies launching CHT for the first timers and even for seasoned developers looking for a quick spin.

For new CHT developers struggling to understand the core of CHT, I would encourage spending sometime understading the basics through the documentation, for instance using the getting started section. It helps a lot in understanding what’s going on under the hood, and even if it doesn’t make sense the first time, just go through it for as many times as it takes.

Another great resource is the CHT Academy Course - Introduction to Building CHT Applications which starts from the very basics with video tutorials and practice exercises giving a hands-on experience building CHT apps.

Finally, the CHT Forum, right here, is like home for any CHT enthusiast. Filled with a community of very supportive senior developers ready to answer any question related to CHT, however basic the question maybe, is a go-to for any challenges or new ideas related to CHT.

I hope this too will help other new developers struggling to get started with CHT.

5 Likes

@sookwalinga - you have such kind words! Your advice on how how to get started with the CHT is well said - thanks so much for sharing.

1 Like