Hi,
in our official repo there is a sample .env file. We used that approach and we created a .env file because some of the env values are shared between the Knowage container and MariaDB container: for example, the database name, user and password.
We will write a better README for sure but this is only a feature suggested by docker-coppose documentation, it is non mandatory at all.
But anyway, please watch out to the database name, user and password, those 3 must be the same between knowage and the DB. Also the database hostname and port are very important.
About the last part of your question, please take a look at the official documentation of MariaDB image, specifically the environment variables section. MariaDB setups the database via env vars. If you take a look into our official docker-compose.yml you can see:
knowagedb: |
| image: mariadb:10.3 |
| environment: |
| - MYSQL_USER=$DB_USER |
| - MYSQL_PASSWORD=$DB_PASS |
| - MYSQL_DATABASE=$DB_DB |
| - MYSQL_RANDOM_ROOT_PASSWORD=yes |
| networks: |
| - main |
| volumes: |
| - "db:/var/lib/mysql" |
This is a fundamental section, please check it carefully.