Merge branch 'frappe:main' into main

This commit is contained in:
Chris Irag 2026-07-03 07:37:34 +08:00 committed by GitHub
commit 83d0fc947c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 91 additions and 27 deletions

View File

@ -86,7 +86,7 @@ jobs:
steps:
- name: Checkout builder repository
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
repository: ${{ inputs.builder_repository }}
ref: ${{ inputs.builder_ref }}

View File

@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Setup QEMU
uses: docker/setup-qemu-action@v4
@ -38,7 +38,7 @@ jobs:
run: echo "LATEST_BENCH_RELEASE=$(curl -s 'https://api.github.com/repos/frappe/bench/releases/latest' | jq -r '.tag_name')" >> "$GITHUB_ENV"
- name: Build and test
uses: docker/bake-action@v7.1.0
uses: docker/bake-action@v7.3.0
with:
source: .
targets: bench-test
@ -52,7 +52,7 @@ jobs:
- name: Push
if: ${{ github.repository == 'frappe/frappe_docker' && github.event_name != 'pull_request' }}
uses: docker/bake-action@v7.1.0
uses: docker/bake-action@v7.3.0
with:
targets: bench
push: true

View File

@ -94,7 +94,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Setup Python
uses: actions/setup-python@v6

View File

@ -39,7 +39,7 @@ jobs:
erpnext_version: ${{ steps.resolve.outputs.erpnext_version }}
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Resolve image versions
id: resolve
@ -60,7 +60,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Setup QEMU
uses: docker/setup-qemu-action@v4
@ -87,7 +87,7 @@ jobs:
echo "NODE_VERSION=${{ inputs.node_version }}" >> "$GITHUB_ENV"
- name: Build
uses: docker/bake-action@v7.1.0
uses: docker/bake-action@v7.3.0
with:
source: .
push: true

View File

@ -40,7 +40,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Setup QEMU
uses: docker/setup-qemu-action@v4
@ -70,7 +70,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push Docker Hub images
uses: docker/bake-action@v7.1.0
uses: docker/bake-action@v7.3.0
with:
push: true
set: "*.platform=linux/amd64,linux/arm64"
@ -83,7 +83,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push GHCR base images
uses: docker/bake-action@v7.1.0
uses: docker/bake-action@v7.3.0
with:
targets: base-images
push: true

View File

@ -30,7 +30,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6

View File

@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Setup Python
uses: actions/setup-python@v6

View File

@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Update pre-commit hooks
uses: vrslev/pre-commit-autoupdate@v1.0.0

View File

@ -10,7 +10,9 @@
"grapecity.gc-excelviewer",
"mtxr.sqltools",
"mtxr.sqltools-driver-mysql",
"visualstudioexptteam.vscodeintellicode"
"vue.volar",
"esbenp.prettier-vscode",
"charliermarsh.ruff"
],
"settings": {
"terminal.integrated.profiles.linux": {

View File

@ -35,11 +35,11 @@ This allows you to:
Installing apps into a running container is **not supported**.
`bench get-app` is an examples of an common but unsupported action.
`bench get-app` and `bench build` are examples of an common but unsupported actions.
### Why?
- Apps are part of the **Docker image**
- Apps and assets are part of the **Docker image**
- Runtime changes are lost on container recreation
- This ensures reproducibility and stability

View File

@ -0,0 +1,62 @@
---
title: How Assets are handled
---
# Assets Reference
## Problem
The `sites` directory contains both persistent data (site config, uploaded files, etc.) and build-time artifacts (`sites/assets`). Mounting the entire `sites` directory as a Docker volume causes assets to be persisted alongside config, which leads to:
- Stale assets surviving image updates
- Asset/manifest mismatches after rebuilds
- Assets being tied to the volume lifecycle rather than the image lifecycle
## Solution
Assets are moved out of the `sites` volume during the build process and replaced with a **symlink** later on. This means assets are always served from the image layer, while the rest of `sites` remains persistent.
### How it works
During the image build (`Containerfile`), the following is done:
```dockerfile
RUN cp -r /home/frappe/frappe-bench/sites/assets /home/frappe/frappe-bench/assets && \
rm -rf /home/frappe/frappe-bench/sites/assets
```
This runs **before** the `VOLUME` declaration, so the **`sites` volume does not contain any assets at all**.
Additionally an `ENTRYPOINT` is added to the images which adds a **symlink** from `assets` to `site\assets`.
> This is implemented in the entrypoint instead of baking the symlink directly into the image so it also works with pre-existing or already-initialized `sites` volumes.
> Since mounting a volume over `/home/frappe/frappe-bench/sites` hides the image contents at that path, any symlink created during the image build would not be visible inside the mounted volume. The entrypoint recreates the symlink at container startup, ensuring it always exists and automatically repairing older volumes that may not already contain it.
At runtime:
```
/home/frappe/frappe-bench/
├── assets/ ← image layer (ephemeral, always matches the image)
├── sites/
│ ├── assets -> /home/frappe/frappe-bench/assets ← symlink
│ ├── common_site_config.json ← persisted in volume
│ └── <site>/ ← persisted in volume
└── logs/ ← persisted in volume
```
### Volume behavior
| Path | Persistent | Source |
| -------------------------- | ----------------------- | ---------------------- |
| `sites/` (except assets) | ✅ Yes | Named volume (`sites`) |
| `sites/assets` (symlink) | ✅ Yes (symlink itself) | Named volume (`sites`) |
| `assets/` (symlink target) | ❌ No | Image layer |
| `logs/` | ✅ Yes | Unnamed volume |
The `sites/assets` symlink is stored inside the persistent `sites` volume, but its target (`/home/frappe/frappe-bench/assets`) comes from the container image. When the container is recreated or upgraded, the assets directory is recreated from the new image, ensuring assets always stay in sync with the running version.
## Important: `bench build` at runtime
Running `bench build` inside a running container will write new assets and eventually cause a mismatch between `assets.json` and the actual assets, breaking the UI. This can be recovered by recreating the containers
> Note: restarting the containers is not sufficient — they need to be recreated to discard the writable layer.

View File

@ -1,6 +1,6 @@
# Reference: https://github.com/frappe/frappe_docker/blob/main/docs/02-setup/04-env-variables.md
ERPNEXT_VERSION=v16.19.1
ERPNEXT_VERSION=v16.26.1
DB_PASSWORD=123

16
pwd.yml
View File

@ -1,6 +1,6 @@
services:
backend:
image: frappe/erpnext:v16.19.1
image: frappe/erpnext:v16.26.1
networks:
- frappe_network
deploy:
@ -16,7 +16,7 @@ services:
MARIADB_ROOT_PASSWORD: admin
configurator:
image: frappe/erpnext:v16.19.1
image: frappe/erpnext:v16.26.1
networks:
- frappe_network
deploy:
@ -45,7 +45,7 @@ services:
- logs:/home/frappe/frappe-bench/logs
create-site:
image: frappe/erpnext:v16.19.1
image: frappe/erpnext:v16.26.1
networks:
- frappe_network
deploy:
@ -101,7 +101,7 @@ services:
- db-data:/var/lib/mysql
frontend:
image: frappe/erpnext:v16.19.1
image: frappe/erpnext:v16.26.1
networks:
- frappe_network
depends_on:
@ -127,7 +127,7 @@ services:
- "8080:8080"
queue-long:
image: frappe/erpnext:v16.19.1
image: frappe/erpnext:v16.26.1
networks:
- frappe_network
deploy:
@ -146,7 +146,7 @@ services:
FRAPPE_REDIS_QUEUE: redis://redis-queue:6379
queue-short:
image: frappe/erpnext:v16.19.1
image: frappe/erpnext:v16.26.1
networks:
- frappe_network
deploy:
@ -183,7 +183,7 @@ services:
condition: on-failure
scheduler:
image: frappe/erpnext:v16.19.1
image: frappe/erpnext:v16.26.1
networks:
- frappe_network
deploy:
@ -197,7 +197,7 @@ services:
- logs:/home/frappe/frappe-bench/logs
websocket:
image: frappe/erpnext:v16.19.1
image: frappe/erpnext:v16.26.1
networks:
- frappe_network
deploy:

View File

@ -1 +1 @@
pytest==9.0.3
pytest==9.1.1