-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Frequently Asked Questions
- How to install official or custom apps?
- What is the difference between production image and development image?
- How to build assets?
- How to update?
- How to take backups?
- How to install ERPNext on Postgres
- Where to find old Dockerfile(s)?
- How to build arm64 images?
- How to restart bench?
- How to execute bench commands?
- Why do some containers exit?
- SocketIO does not work with pwd.yml
In case of production setup you need to build your custom image for installing apps. This repository only publishes frappe/erpnext image with no additional app. You CANNOT bench get-app in running containers.
To build image refer documentation to build custom apps. To automate it using CI refer this post.
In case of development setup, you can do bench get-app as usual.
The bench image is used for frappe app development. It starts all the required services and a service called frappe with all the tools required for development. It can be used independently or it integrates well with VS Code devcontainers. Read more for development setup.
The production setup is built with immutable application code. It packages just the dependencies and application code required to run in production. These images cannot be used for development or to change and push app code.
You cannot build assets using bench build in running production containers. It will mess up the attached assets volume for the container in which the command was executed. It will cause problems in serving static assets. The asset building process is done during the image build. Images come pre-packaged with built assets and there is no need to build assets in production environment.
Change the image tag for all the frappe framework services, take down all the containers and start them again with new images. Once the containers are running you'll need to migrate sites with bench --site all migrate command. The image and container replacement is done as per the container orchestrator.
As there is no cron schedule running in containers, you will need to setup a cron task manually. Refer documentation for backups, or use this override.
At this moment ERPNext only works with and supports MariaDB.
Check old branches of this git repository. compat, compat-2022, version-10, version-12
Easiest way to build arm64 images is to execute build on arm64 runner. Currently frappe/bench image is made for amd64 and arm64. If you wish to build for multi arch, use --platform flag for buildx command. Refer official docker documentation
ARM64 builds always cause problems with automation, List of PRs and reverts related to ARM64. https://github.com/frappe/frappe_docker/pulls?q=is%3Apr+arm64+is%3Aclosed
Restarting all the containers restarts the bench. Supervisor is not necessary and not available in containers. bench restart WILL NOT WORK. Restart with orchestrator specific commands.
As a quick fix you can enter into gunicorn container and execute commands. As a good practice you can start a separate container with sites volume attached and attached to common network of existing containers and execute the commands. If done from separate container even if any thing changes the app code, it'll only affect the temporary container started to execute commands.
configurator service from pwd.yml or compose.yaml and create-site service from pwd.yml will exit with status code 0 after completion. They are only executed once and closed. Reference in documentation.
For socketio to work host header must match site name. Code
In case of localhost setup make following changes to pwd.yml:
- Set environment variable
FRAPPE_SITE_NAME_HEADERunderfrontendservice to$$host. Code line to change - Change site name from
frontendtofrontend.localhostundercreate-siteservice command. Any name appended by.localhostcan be chosen. Code line to change - Add
frontend.localhost:host-gatewayinextra_hostsunderwebsocketservice. Note: Choose appropriate site name that was created and set above. Code region where to add the extra parameter, Link to docker compose specification of extra_hosts paramater
In case of production setup make following changes to pwd.yml:
- Set environment variable
FRAPPE_SITE_NAME_HEADERunderfrontendservice to$$host. - Change site name from
frontendtoerp.example.comundercreate-siteservice command. Any domain name that resolves to the server IP can be used here.
Learn about how SocketIO technically works: socket.io is a specific computer communications protocol based on the engine.io protocol which in turn is built on the transports HTTP long-polling (as a fallback) and the WebSocket (with examples) defined by RFC 6455. Since both engine.io and socket.io use a fixed URI prefix string for communication over http, this begs the question: Do we really need two ports for adding SocketIO functionality to FrappeFramework, or can a http routing be built into the framework which runs over the same port as the rest of the Framework's communication? This would render obsolete the need to thread a second communication path through the frontend and the docker network separations for SocketIO, which would facilitate setting up port based multitenancy with docker-based and frontend/proxy/ingress using setups.