Everything about Frappe and ERPNext in containers.
To get started you need Docker, docker-compose, and git setup on your machine. For Docker basics and best practices refer to Docker's documentation.
Once completed, chose one of the following two sections for next steps.
First clone the repo:
git clone https://github.com/frappe/frappe_docker
cd frappe_docker
export APPS_JSON_BASE64=$(base64 -w 0 ./development/apps.json)
base64 -i ./development/apps.json -o ./development/apps.json.b64
export APPS_JSON_BASE64=$(base64 -i ./development/apps.json)
echo $APPS_JSON_BASE64
docker build \
--build-arg=FRAPPE_PATH=https://github.com/frappe/frappe \
--build-arg=FRAPPE_BRANCH=version-15 \
--build-arg=PYTHON_VERSION=3.11.6 \
--build-arg=NODE_VERSION=18.18.2 \
--build-arg=APPS_JSON_BASE64=$APPS_JSON_BASE64 \
--no-cache \
--platform=linux/amd64 \
--tag=frappe-custom:latest \
--file=images/custom/Containerfile .
docker images
docker run -d frappe-custom:latest
docker ps
docker exec -it {CONTAINER_ID} /bin/bash
docker push frappe-custom:latest
Replace image and erpnext install command in pwd.yml.
sed -i 's|frappe/erpnext:v15.45.5|frappe-custom:latest' pwd.yml
# sed -i 's|--install-app erpnext|--install-app custom|g' pwd.yml
docker compose -p frappe-custom -f pwd.yml up -d
Check site logs
docker logs frappe-custom-create-site-1 -f
Open site http://localhost:8080
After cloning the repo run this command to build multi-architecture images specifically for ARM64.
docker buildx bake --no-cache --set "*.platform=linux/arm64"
and then
- add
platform: linux/arm64
to all services in the pwd.yaml - replace the current specified versions of erpnext image on
pwd.yml
with:latest
Then run: docker compose -f pwd.yml up -d
Wait for 5 minutes for ERPNext site to be created or check create-site
container logs before opening browser on port 8080. (username: Administrator
, password: admin
)
If you ran in a Dev Docker environment, to view container logs: docker compose -f pwd.yml logs -f create-site
. Don't worry about some of the initial error messages, some services take a while to become ready, and then they go away.
bench --site development.localhost restore --admin-password {password} frontend-database.sql.gz
bench new-app custom
bench --site development.localhost install-app custom
bench --site development.localhost migrate
bench --site development.localhost clear-cache