Skip to content

Docker images for production and development setups of the Frappe framework and ERPNext

License

Notifications You must be signed in to change notification settings

rogerznts/frappe_docker

 
 

Repository files navigation

Build Stable Build Develop

Everything about Frappe and ERPNext in containers.

Getting Started

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.

Try on your Dev environment

First clone the repo:

git clone https://github.com/frappe/frappe_docker
cd frappe_docker

FOR WINDOWS

export APPS_JSON_BASE64=$(base64 -w 0 ./development/apps.json)

FOR MAC

base64 -i ./development/apps.json -o ./development/apps.json.b64

export APPS_JSON_BASE64=$(base64 -i ./development/apps.json)

Verify generated hash

echo $APPS_JSON_BASE64

Docker build command

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 .

List all the images, you should see first_image in the list

docker images

Run the docker image in the background using the -d tag

docker run -d frappe-custom:latest

List running images to get the container id of our image

docker ps

Exec into the container to check if all apps are in the image

docker exec -it {CONTAINER_ID} /bin/bash

Push image

docker push frappe-custom:latest

Try image

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

Start services

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

To run on ARM64 architecture follow this instructions

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

Final steps

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.

Database restoration

bench --site development.localhost restore --admin-password {password} frontend-database.sql.gz

Create custom app

bench new-app custom

Install custom app

bench --site development.localhost install-app custom

Migrate database changes

bench --site development.localhost migrate

Clear app cache

bench --site development.localhost clear-cache

Documentation

About

Docker images for production and development setups of the Frappe framework and ERPNext

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 46.5%
  • Dockerfile 36.6%
  • Shell 10.5%
  • HCL 6.4%