dina-web-nrm / collections-data-model-docker

Integration project for Complex Collection Objects data model proof of concept. (using liquibase and provides support for several database backends)
GNU Affero General Public License v3.0
0 stars 0 forks source link

Parameterized async services #3

Closed mskyttner closed 8 years ago

mskyttner commented 8 years ago

This refactors the project and can be applied to other docker projects in DINA-Web. It uses "wait-for-it.sh" in one of the services that depend on another service to be available. See the Dockerfile.

This technique can and should be used elsewhere where services don't yet take into account that other services that it depends on can go away at any time. In this case, the database schema doesn't get created until the database engine service is available (tcp on internal port 3036).

Also, it adds a couple of backup targets to the Makefile, to do backups in sql format and of the raw datadir files. Again this technique should be relevant to any other docker projects in DINA-Web.

Finally, it uses a ".env"-file to store environment variables which can then be used both in docker-compose.yml and in the Makefile.

mskyttner commented 8 years ago

@caalle @jmenglund @gnewton @Inkimar pls have a look to see if you can "git clone", then "make" to manage the lifecycle of this composition ie bring up services, "make backup-datadir" or "make backup-sqldump" to make backups and "make clean" to remove it all? Any ideas for improvements?

I added an example of a small "alpine linux" component that could serve as something that could go around services and makes backups for example. That pattern too could be used across services and not only here.

mskyttner commented 8 years ago

@Inkimar could you approve this PR and merge it in with any necessary amendments you'd like? Perhaps the include .env in Makefile, for example? By the way, it is this repo (the collections-data-model-docker) that can execute the "make connect" target.

Inkimar commented 8 years ago

a change in the README.md , how to change from MariaDB ( the default engine ) to Mysql