Update Containerfile by adding bench setup requirements so All dependencies for all apps are already available. No need to know the site name in advance. and no need to setup requirements after site creation manually

bench setup requirements reads all apps’ pyproject.toml / requirements.txt and installs the Python packages into the bench virtual environment.

Later, when you dynamically create sites via:
docker compose --project-name erpnext-one exec backend \
  bench new-site --mariadb-user-host-login-scope=% --db-root-password changeit \
  --install-app erpnext --admin-password changeit one.example.com

All dependencies for all apps are already available.
No need to know the site name in advance.

This is fully compatible with the single-server-example.md workflow and supports multiple sites, dynamic app installation, and custom app dependencies.
This commit is contained in:
Malay Gondalia 2025-09-23 14:04:47 +05:30 committed by GitHub
parent 8b523ca125
commit a4ca5ac8c2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -129,7 +129,8 @@ RUN export APP_INSTALL_ARGS="" && \
/home/frappe/frappe-bench && \
cd /home/frappe/frappe-bench && \
echo "{}" > sites/common_site_config.json && \
find apps -mindepth 1 -path "*/.git" | xargs rm -fr
find apps -mindepth 1 -path "*/.git" | xargs rm -fr && \
bench setup requirements
FROM base AS backend