Editing (Customising) openmrs files within docker container

Hello community

Is there a way to edit files within a docker container. There are several files that I need to edit as I begin to customise the application to meet our use cases. I tried editing the file /openmrs/data/bahmni_config/openmrs/apps/registration/app.json but there is a message that says the file system is read only

From the articles that I have seen online it seems editing files within a container is not best practice

Yes, in general, one should avoid making edits within the container, since containers are ephimeral, and get destroyed / recreated. Sometimes people make temporary changes, just to check if things work, but in general, with docker / docker-compose, edits are done outside on host filesystem – and containers then pick those changes when they start.

For your current requirement, which is modifying Bahmni config, please see this: https://bahmni.atlassian.net/wiki/spaces/BAH/pages/3117449270/Using+Implementation+specific+Configuration+docker#Local-development-on-config

You need to clone the config folder on your local machine.

Bahmnni LITE uses clinic-config https://github.com/Bahmni/clinic-config

Once you have cloned the folder locally. Update the .env to point to this new folder. Then start Bahmni docker-compose, so it uses this folder for configuration, rather than the config docker image. Test your bahmni to see it works OK. Then you can make direct edits to files in this subfolder and see the changes reflect in your bahmni instance.

cc: @mohant

1 Like