Hi Everyone
I’m trying to update my local Containerized ERPNext instance branches using “Bench update”, but command not executing and also not throwing any errors to identify.
Screenshot attached below for your reference.
Please do let me know any other command should I use instead “Bench Update” in Docker ERPNext instance.
Thanks in advance
Bench update won’t work in production containers.
Containers are immutable, you’ve to replace them with new ones.
You’ve to change the VERSION environment variables and re-deploy the containers.
Then you’ll need to migrate sites frappe_docker/site-operations.md at main · frappe/frappe_docker · GitHub
By screenshot you’re using development setup.
Pull the latest frappe/bench:latest docker image and then try rebuilding the devcontainers
1 Like
Hi @revant_one
Thank you for quick response,
Could you please tell me in which file I need to change the Version, because I’m new this docker setup.
And I would like to explain my requirement :
My requirement is we are already using ERPNext V12 and customApp with some transaction, we would like to upgrade our ERPNext version from V12 to V13.
Hello @revant_one ! The link you’ve mentioned is broken:
I’ve updated my app with a new JS located in apps’ public folder, but even running bench migrate in the container after pulling a new image, the new JS file wasn’t created in sites/assets folder
What version file do you mean?
PS: frappe and erpnext versions still the same in the docker image, I’ve changed just my app
1 Like
we removed wiki links
briefly it mentioned,
- setup fresh bench
- restore sites from production
- Run migration to find failing patches.
it’ll help you safely run migration on production by trying it out on fresh setup.
you’ll need to populate new assets in assets volume for shared use by worker containers.
example.
# populate-assets:
# image: frappe/erpnext-nginx:${VERSION}
# deploy:
# restart_policy:
# condition: none
# entrypoint: ["sh", "-c"]
# command:
# - >
# cp -fR /usr/share/nginx/html/assets /data;
# touch /data/sites/.build;
# volumes:
# - assets:/data/assets:rw
# - sites:/data/sites:rw
use restart instead of restart_policy if not using swarm
Thanks @revant_one for answer! I understand that files should be copied, but doesn’t it have any existing script in frappe or erpnext image that does this copy autommaticaly?
It also has to update assets.json with the new scripts, or not?
In order to explain better the situation, my app it’s called “soma”, so when I go in the backend container, I see the new JS files in /frappe-bench/apps/soma/soma/public folder, but they aren’t present in /home/frappe/frappe-bench/sites/assets , even the “soma” folder wasn’t created inside the assets folder.
In development environment, running bench build created “soma” folder inside assets with my new scripts, but in Docker there isn’t bench build.
I believe that some step of the image build or a script should do this copy, besides your suggestion to do it in docker-compose.
Could we have a script within the frappe docker image to rebuild custom app assets?
manual steps mentioned here frappe_docker/setup-options.md at main · frappe/frappe_docker · GitHub
for helm we’re using initContainer to populate-assets
any better way you can suggest to make it into a script?
Hi @revant_one ,
I have overridden a frappe JS function through my custom app and added the path in app_include_js
. It is working fine in my local. However, after deploying it to production (running in Docker), it is not working. The console shows the following error:
GET https://finance-staging.app/assets/finance_erpnext/js/custom_number_format.js net::ERR_ABORTED 404 (Not Found)