I was recently working on a simple docker-based setup and ran across a couple things that I think should change in the OOTB/example docker compose YML files in moqui-framework/docker.
- the new version of Docker Compose seems to be a plugin to docker instead of a separate app and all old docker-compose options are now in docker itself under the compose command; to update this all we need to do is change
docker composein the compose-up.sh and compose-down.sh files
- update all compose files to use OpenSearch instead of ElasticSearch; in a first attempt this went pretty well, but OpenSearch has security on by default so the compose file includes user and password default settings, and uses https instead of http to access the OpenSearch server (these are benefits in addition to OpenSearch vs ElasticSearch licensing, and a good example of how OpenSearch is filling in the old ElasticSearch paywalled functionality)
- add opensearch-dashboards which has some admin functionality as well as Kibana-like functionality
- update to Postgres 14.5; in limited tests this is working well with moqui and with the same settings and such as the prior version referenced there (12.1); note that 12.1 isn’t terribly old, but Postgres has been quite active in recent years
- add JAVA_TOOL_OPTIONS env var to the moqui-server container config to limit heap size to 1024m by default, along with the OPENSEARCH_JAVA_OPTS that limits OpenSearch to 512m; these should of course be changed as needed, along with everything else in these sample compose YML files
I also added a little script for rotating backups of a Postgres DB with comments about crontab settings and such, by default for once per day (via crontab) with a 30 day retention (change the script to change that).
Here is a PR with the changes: Comparing master...dcompose-updates · moqui/moqui-framework · GitHub
These together make a good example for a single-server setup using docker containers for all the infrastructure Moqui needs, plus a bit to help when using Postgres which these days I’m thinking is a good default recommended database for Moqui.
I think most changes are for sure a good idea, like using OpenSearch and in a more secure way than ElasticSearch, but not sure about changing from
docker compose to use the new plugin… it looks like that’s the standard way to do it now but I’m wondering what others are seeing, or might run into given that this is not a backward compatible change (which I’m not as worried about, these are example config files meant to be changed… at least for the passwords and encrypt key!
If all looks good the next step will be making similar changes to the other compose files in moqui-framework/docker.