Use easy-install.py to build custom container images

easy-install.py is used to install ERPNext on a single VM. Users had to build image with custom apps separately. Although it is documented here frappe_docker/docs/custom-apps.md at main · frappe/frappe_docker · GitHub, it is not part of any script.

This PR adds build command to easy-install.py: feat: easy-install.py to build custom images by revant · Pull Request #1592 · frappe/bench · GitHub

To test it:

  1. Download the easy install (if PR is not merged, use my fork to download the script)
# wget https://raw.githubusercontent.com/frappe/bench/refs/heads/develop/easy-install.py
wget https://raw.githubusercontent.com/revant/bench/refs/heads/easy-build/easy-install.py
  1. Prepare the apps.json, create your own or download my apps.json.
# nano apps.json
wget https://gitlab.com/castlecraft/cepl-erpnext-images/-/raw/main/apps.json
  1. Build image
python3 easy-install.py build --apps-json=apps.json --tag custom-apps:v202410291200

Command loads apps.json and tags the image as custom-apps:v202410291200

  1. Deploy as docker compose project build_test
python3 easy-install.py -p -n build_test --email test@frappe.io --image custom-apps --version v202410291200 --app erpnext --app hrms --app india_compliance --app wiki --app payments --app webshop

This will create a site and install apps specified.

5 Likes

Updated readme bench/README.md at easy-build · revant/bench · GitHub

  • build and deploy or migrate in one command
  • exec into project setup
  • upgrade existing setup

Hello sir
i have a doubt and an issue which i’m trying to solve since many days

i have used easy-script to run erpnext using docker in production setup with developer mode on.
with a particular project name, sitename , etc.
and it creates 3 files saved in some directory

{project-name}-passwords.txt
{project-name}.env
{project-name}-compose.yml

related to the project, and we always use this compose file generated, to pul down or start our project, since the passwords and .env etc. are already used in this compose file.

Now, i want to install new custom-apps, i was earlier trying to install them using manual method inside the backend container, turns out, there were lot of overwriting and replacements happening inside the containers due to configurator, frontend container and services, etc.

Then i’ve followed the build method specified here
Custom-Apps Build
and the custom-app-image with all custom apps has been built

Now how can i use this new custom-image, on my existing project,
becuase i already have users and entities actively using it
and i dont want to take backup and restore on new site, because everytime we feel, if we want to remove or install new apps, we have to do this whole process again.

Can you please provide some blog, article, video or guidance on how to use this new custom image built on top of exsiting project?

Thankyou so much!

image

My new custom build image name is cc1:v1
and i’ve also made changes in {project-name}-compose.yml file
like i changed image from frappe/erpnext-15 to cc1:v1

and then run
docker compose -f {project-name}-compose.yml up -d --build

But it doesnt show any of the apps there?
please help ?

Solution for now:
Once the image is built use that as mentioned in the above post,
by replacing the image parameter for all services with custom-image-name and tag

and also, apps would need to be installed in backend container,
so just do docker exec -it {project-name}-backend-1 /bin/bash which will take you inside backend container

and then run bench install-app {you-app-name}, this will install your app

then do bench migrate

then exit the backend-container

then run docker compose -f {project-name}-compose.yml restart


This way i’m able to run the custom-apps or new-apps inside existing production application