I can build and install plain erpnext using docker-compose at least one time in two (I have found a problem where the assets.json file gets out of step with the randomly generated asset names, usually every other build). Especially now I have realised you need to migrate if you are using an existing database, because the code might have changed (I added that into the create-site container in my docker-compose.yml, and it helped a lot).
But I keep hitting issues caused by my not understanding docker properly (especially volumes).
I started with a plain erpnext install. Then we realised we needed the notforprofit app. So I rebuilt to add that, and it didn’t work. That’s because the rebuild created a new volume with the new apps.json in it, but docker-compose up ignored that, and used the old volume, with the old apps.json in it.
In a plug-and-play dockerised app, there would be some code that recognised the new build was connecting with an old volume, and set about upgrading anything in the old volume that needed it.
So I just deleted my sites volume, and re-deployed. Now the new frappe can’t connect to the database, because it has created a new site_config.json, with a new random database password, but it hasn’t granted access to the frappe user with that password.
All very fine if you fully understand frappe, and are prepared to patch files in your volume after running it, but not exactly plug and play.
So I edited the database password in the sites volume to be the same as the old one. Now it connects, but there is still no sign of the apps in the site. Apps.json is correct.
Looking at the create-site logs, I find ERPNext can only be installed on a fresh site where the setup wizard is not completed.
. So it looks as if I have to trash my database volume too. But how would you go about installing a new app to an existing site?
I’m writing this down both to explain my problems, and to enlighten anyone else who comes along later and experiences any of these issues.