Description of the issue
I run a CI powered, docker based setup with a custom image.
In my CI environment, I build the custom container image. After the image is built, I run some docker compose commands on my server:
docker compose down
docker compose pull
docker compose up -d
docker compose exec backend bench migrate
docker compose exec redis-cache redis-cli FLUSHALL
This worked well, until #1879. Now, the bench migrate command creates a new assets.json, which is stored with the frontend container as it is stored in /home/frappe/frappe-bench/sites/assets/ folder, and with that in the sites volume.
The css/js files itself are stored in /home/frappe/frappe-bench/apps/, which is not shared between the containers. There are symlinks from the assets forlder to the apps folder. So after running the migration in the backend container, the css/js files in the backend container are updated, but not that files in the frontend container. But as the assets.json file is shared, the frontend cannot find the assets and the user get's 404 errors.
In the past, it looks like it worked by accident. I run bench migrate in the backend container, and bench updated css/js in the backend container, and the assets.json in a unnamed volume, which was not shared with the frontend container. So the frontend container still served the "old" version of these files.
I understand that the css/js files should not be build in productive environment. But I need to run the migrations.
How to run migrations without building the assets?
Context information (for bug reports)
Steps to reproduce the issue
- Build a custom app image
- Update container using that image
- Run
bench migrate in the backend container
Observed result
assets.json and accessable files are out of sync.
Expected result
bench migrate should not manipulate assets.json file.
Stacktrace / full error message if available
Description of the issue
I run a CI powered, docker based setup with a custom image.
In my CI environment, I build the custom container image. After the image is built, I run some docker compose commands on my server:
This worked well, until #1879. Now, the
bench migratecommand creates a newassets.json, which is stored with the frontend container as it is stored in/home/frappe/frappe-bench/sites/assets/folder, and with that in thesitesvolume.The css/js files itself are stored in
/home/frappe/frappe-bench/apps/, which is not shared between the containers. There are symlinks from the assets forlder to the apps folder. So after running the migration in the backend container, the css/js files in the backend container are updated, but not that files in the frontend container. But as theassets.jsonfile is shared, the frontend cannot find the assets and the user get's 404 errors.In the past, it looks like it worked by accident. I run
bench migratein the backend container, and bench updated css/js in the backend container, and theassets.jsonin a unnamed volume, which was not shared with the frontend container. So the frontend container still served the "old" version of these files.I understand that the css/js files should not be build in productive environment. But I need to run the migrations.
How to run migrations without building the assets?
Context information (for bug reports)
Steps to reproduce the issue
bench migratein the backend containerObserved result
assets.jsonand accessable files are out of sync.Expected result
bench migrateshould not manipulateassets.jsonfile.Stacktrace / full error message if available