How to install install mutiple apps on frappe like ERPNext, HRMS, CRM, Insights directly from a docker compose file?
Hi,
This video may be helpful:
The use of [custom-apps.json](Build With Hussain · GitHub
bwh_frappe_essentials/blob/main/ci/apps.json) is used an example early on, although I’m not sure how this could be used with docker compose ( I’m still learning). See also frappe_docker/docs/custom-apps.md at main · frappe/frappe_docker · GitHub
@edardev In case you didn’t figure this one out. One way to accomplish this via a custom image is to leverage an environment variable in your .env file. You will want to first generate your custom image to include the apps that you want to install into your site, as noted by @smino. However, once you’ve accomplished this part, you can create a variable that is passed in the create site command. So in your case, you would put something like this in your .env file:
INSTALL_APPS="--install-app erpnext --install-app hrms --install-app crm --install-app insights"
Then, in your docker yaml file, in the create site container in your command section, you would simply put that variable somewhere appropriate in the order of commands. So, it might look something like:
bench new-site "${SITE_NAME}" --mariadb-user-host-login-scope='%' --admin-password "$(cat /run/secrets/erp-admin-pw)" --db-root-username root --db-root-password "$(cat /run/secrets/db-root-password)" ${INSTALL_APPS} --set-default;
This will go ahead and run the install-app command for each app in the variable value list as part of your create site command. Works well as long as your custom image has those apps built in.
Hope this helps.
To create docker multi-site and multi-app please use easy-install.py: -
-
wget https://raw.githubusercontent.com/frappe/bench/develop/easy-install.py
-
In “frappe_docker/development/apps-example.json” edit your apps with their branch: -
[
{ “url”: “GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP)”, “branch”: “version-15” },
{ “url”: “GitHub - frappe/hrms: Open Source HR and Payroll Software”, “branch”: “version-15” },
{ “url”: “GitHub - frappe/education: Open source education / school management system”, “branch”: “version-15” },
{ “url”: “GitHub - frappe/crm: Fully featured, open source CRM”, “branch”: “main” },
{ “url”: “GitHub - frappe/wiki: Free and Open Source Wiki built on top of Frappe”, “branch”: “master”},
{ “url”: “GitHub - Aakvatech-Limited/csf_tz: Country Specific Functionality Tanzania”, “branch”: “master”}
] -
python3 easy-install.py build
-
python3 easy-install.py deploy --image=custom-apps --version=latest --sitename=bench3site1.duckdns.org --sitename=bench3site2.duckdns.org --sitename=bench3site3.duckdns.org --app=erpnext --app=hrms --app=education --app=crm --app=wiki --app=csf_tz
For step 4 and 5 if you want more options rather than default values please check out https://github.com/frappe/bench
Don’t forget to add the sites to your host file
If someone can test and let me know