opened 11:19AM - 29 Mar 26 UTC
bug
## Description of the issue
When using the official production/custom images fr… om frappe_docker, the container declares both:
```
/home/frappe/frappe-bench/sites
/home/frappe/frappe-bench/sites/assets
```
as Docker volumes.
If docker-compose only mounts sites (as in the standard setup), Docker creates anonymous per-container volumes for sites/assets.
This can lead to a split asset state between containers, causing:
• mismatched assets.json
• missing hashed CSS/JS bundles
• partially broken ERPNext UI
## Context information (for bug reports)
**Symptoms**
• Browser console shows 404 errors for hashed assets (e.g. desk.bundle.*.css)
• MIME type errors (text/html instead of text/css)
• ERPNext UI partially broken (layout/styles missing)
• Custom apps (e.g. Mint) may still appear to work
• Running bench build in one container makes things worse
• Restarting containers does not fix the issue
**Root Cause**
The image defines:
```
VOLUME [
"/home/frappe/frappe-bench/sites",
"/home/frappe/frappe-bench/sites/assets",
"/home/frappe/frappe-bench/logs"
]
```
But the default compose setup only mounts:
`sites:/home/frappe/frappe-bench/sites`
As a result:
• /sites → shared named volume ✅
• /sites/assets → anonymous volume per container ❌
This causes backend and frontend containers to read/write different asset directories, leading to manifest/hash mismatches.
## Steps to reproduce the issue
1. Have been using a standard frappe_docker setup
2. Build a new layered docker container to be able to include apps (docs/02-setup/02-build-setup.md )
3. Install a custom app (e.g. Mint) or run bench build
4. Access ERPNext UI
5. Observe missing/broken assets in browser
You can verify the issue with:
`docker inspect <container> --format '{{json .Mounts}}'`
You will see different anonymous volumes mounted at:
`/home/frappe/frappe-bench/sites/assets`
### Observed result
Missing/broken assets in browser
### Expected result
Working front end
### Fix / Workaround
Explicitly mount a shared named volume for sites/assets across all relevant services:
docker-compose.override.yaml:
```
services:
backend:
volumes:
- sites:/home/frappe/frappe-bench/sites
- sites-assets:/home/frappe/frappe-bench/sites/assets
frontend:
volumes:
- sites:/home/frappe/frappe-bench/sites
- sites-assets:/home/frappe/frappe-bench/sites/assets
configurator:
volumes:
- sites:/home/frappe/frappe-bench/sites
- sites-assets:/home/frappe/frappe-bench/sites/assets
volumes:
sites:
sites-assets:
```
**Expected Behavior**
After recreating containers, backend and frontend will share the same asset state and the issue is resolved.
All containers should operate on a single coherent asset directory, so that:
• assets.json
• built JS/CSS bundles
are consistent across backend and frontend.
**Notes**
• This issue may not appear in simple vanilla (Production) setups but becomes visible when:
• installing custom apps
• rebuilding assets
• running multiple containers with different lifecycle timing
• The problem is subtle and difficult to diagnose without inspecting Docker mounts
I am facing an error like above.
The “named volumes“ overriding method is temporarily solving it, but when I rebuild the image, the bug appears again.
If anyone knows the permanent solution for this, or any guesses as to why rebuilding image with new custom tag might be causing the issue, the help would be greatly appreciated!
Hi @RevatiJagdale
How are you currently pulling new versions? what command are you exactly using?
This issue should be fixed now
main ← ews-pgasser:fix/remove-nested-sites-assets-volume
opened 01:42PM - 20 Apr 26 UTC
## What does this PR do?
Removes the nested `sites/assets` volume declaration… from the layered `Containerfile` and adds documentation explaining the change and upgrade steps.
## Problem
Previous images declared `VOLUME /home/frappe/frappe-bench/sites/assets` separately alongside the `sites` volume. This created an implicit nested mountpoint inside the `sites` volume, which caused Docker to attach different anonymous volumes per container in multi-container setups — leading to inconsistent asset serving.
## Changes
- **`images/layered/Containerfile`**: Removed the redundant `sites/assets` volume declaration. `sites` is now the single shared mount, consistent with the compose setup.
- **`docs/02-setup/02-build-setup.md`**: Added an upgrade section explaining the breaking change and the required steps for users pulling the updated image.
## Upgrade steps for existing users
- Recreate all containers with `docker compose up --force-recreate`
- No `bench build` needed — this only fixes mount consistency, not the asset workflow
Fixes #1850