Dear all,
I used the openmrs-sdk to generate the docker-compose file : mvn openmrs-sdk:build-distro which is working fine. However, in my case I have to use an external database server. So I modified, like mentioned in the wiki , in the .yml file by removing the db service part and setting up my external database as mentioned here . here is my yml file : # Generated automatically by openmrs SDK version: ‘2’
services:
web:
build: web
image: referenceapplication:1.0.0-snapshot
environment:
DB_DATABASE: openmrsdocker
DB_HOST: my_ip_address
DB_USERNAME: my_dv_user
DB_PASSWORD: my_db_password
DB_CREATE_TABLES: 'true' # change to 'true' if using an empty database
DB_AUTO_UPDATE: 'true' # change to 'true' if using an empty database
MODULE_WEB_ADMIN: 'true' # allow web admin on OpenMRS
volumes:
- web-data:/usr/local/tomcat/.OpenMRS
- /usr/local/tomcat/.OpenMRS/modules/ # used to mount persistent docker volume for modules
- /usr/local/tomcat/.OpenMRS/owa/ # used to mount persistent docker volume for owa
volumes:
web-data:
But it doesn’t work. And I had two different behaviors depending on my database server location: When I refer to my local database in the same machine with my docker. It looks like the connection is ok but I have this error message :
2019-03-08 08:18:57,879| Got exception while starting up:
web_1 | java.lang.RuntimeException: Error occurred while trying to get the updates needed for the database. Unable to get a connection to the database. Please check your openmrs runtime properties file and make sure you have the correct connection.username and connection.password set
web_1 | at org.openmrs.util.DatabaseUpdater.getUnrunDatabaseChanges(DatabaseUpdater.java:628)
web_1 | at org.openmrs.util.DatabaseUpdater.getUnrunDatabaseChanges(DatabaseUpdater.java:584)
web_1 | at org.openmrs.util.DatabaseUpdater.updatesRequired(DatabaseUpdater.java:249)
web_1 | at org.openmrs.web.Listener.setupNeeded(Listener.java:222)
And when I refer to an external server. The process stopped earlier with timeout error:
web_1 | owa.openmrs-owa-sysadmin=1.2
web_1 | version=1.0.0-SNAPSHOT
web_1 | war.openmrs=2.1.4
web_1 | -----------------------------------
web_1 | + echo -----------------------------------
web_1 | + /usr/local/tomcat/wait-for-it.sh --timeout=3600 xxxxxxxx:3306
web_1 | wait-for-it.sh: waiting 3600 seconds for xxxxxxxx:3306
web_1 | wait-for-it.sh: timeout occurred after waiting 3600 seconds for xxxxxxxx:3306
Do you have any feedback on that ? @mksd @lilian
Thanks a lot in advance Regards