How to setup frappe benches, sites and custom domains with dokploy

Recently ERPNext template was added to dokploy.com by @buildwithhussain, with that users can now have complex setup on a single vm or docker swarm cluster.

The github gist tries to showcase:

  • creation of first bench for “erpnext” with one site.
  • add custom domain pointing to existing site on bench for “erpnext”.
  • add new site and domain for the “erpnext” bench.
  • creation of second bench for “crm” with one site.
  • add custom domain pointing to existing site on bench for “crm”.
  • add new site and domain for the “crm” bench.

How to setup: Advance frappe benches with Dokploy · GitHub

9 Likes

Thanks @revant_one @buildwithhussain
Really useful :slight_smile:

looks great, thanks. Is it also easy to add additional modules/apps this way? Eg non_profit, crm, alyf/banking?

You need to build custom image and deploy by changing the IMAGE_NAME and VERSION env var.

Now Frappe HR is available as template on Dokploy, feat(template): frappe HR, open source HR & Payroll software by NagariaHussain · Pull Request #1239 · Dokploy/dokploy · GitHub

1 Like

How do you deploy multiple apps on one site for example to install ERPNEXT, HRMS and CRM onto the portal.domainname.com? in a dokploy container?

  • To install custom list of apps build custom image
  • To install apps available from official images use Dokploy templates

Hi Revant
Thank you very much for your response, what i actually meant to ask is that "Can you be able to deploy those 2 Dokploy templates (i.e ERPNEXT and HRMS ) onto one site portal.domainname.com?

No, you will need to build another image with crm in it.

Btw frappe hr will install erpnext as it depends on it.

2 Likes

Hi Revant. Firstly, you are doing an amazing job! I wanted to share my appreciation. Secondly, I assume what the other user meant was: once you build a custom image that has all the custom apps, e.g. erpnext, hrm, ecommerce integrations, etc. How do you modify one of the existing templates in dokploy? E.g. below is the environment variables from the erpnext template in dokploy:

SITE_NAME=erp.examplesite.com
ADMIN_PASSWORD=123
DB_ROOT_PASSWORD=123
MIGRATE=1
ENABLE_DB=1
DB_HOST=db
CREATE_SITE=1
CONFIGURE=1
REGENERATE_APPS_TXT=1
INSTALL_APP_ARGS=--install-app erpnext
IMAGE_NAME=docker.io/frappe/erpnext
VERSION=version-15
FRAPPE_SITE_NAME_HEADER=

Would the following changes be correct:

# if not correct, please suggest how to add the custom app names
INSTALL_APP_ARGS=--install-app erpnext hrms ecommerce_integrations payments print_designer insights builder
IMAGE_NAME=ghcr.io/name/custom-erpnext:latest
VERSION=version-15

Also, in order to self-host multiple custom apps in dokploy, are there are specific considerations to keep in mind when building a custom image? Any particular setting that needs to change or an environment variable that needs to be added?

You, Revant, and Hussain, have contributed greatly to make self-hosting erpnext as easy as possible. The whole community is grateful!

I removed the custom app names from the INSTALL_APP_ARGS, and left it as it was:

INSTALL_APP_ARGS=--install-app erpnext

Then added the following to the create-site service command in the compose:

  create-site:
    ...
    command:
        ...
        # below line already exist in the template:
        bench new-site --mariadb-user-host-login-scope='%' --admin-password=$${ADMIN_PASSWORD} --db-root-username=root --db-root-password=$${DB_ROOT_PASSWORD} $${INSTALL_APP_ARGS} $${SITE_NAME};
        # add custom apps here:
        bench --site $${SITE_NAME} install-app hrms;
        bench --site $${SITE_NAME} install-app ecommerce_integrations;
        bench --site $${SITE_NAME} install-app payments;
        bench --site $${SITE_NAME} install-app print_designer;
        bench --site $${SITE_NAME} install-app insights;
        bench --site $${SITE_NAME} install-app builder;

All custom apps are installed without any errors and worked great. Revant and Hussain’s input is still crucial, or to confirm if this could be a way to go about it.

Please know that you have to build a custom image with your custom apps, and add the custom image to the environment variables, if your custom image is:

ghcr.io/ur-name/custom-erpnext:latest

Then you have to add it as:

IMAGE_NAME=ghcr.io/ur-name/custom-erpnext
VERSION=latest

Reference from the template:

IMAGE_NAME=docker.io/frappe/erpnext
VERSION=version-15

This won’t work:

IMAGE_NAME=ghcr.io/ur-name/custom-erpnext:latest

Great tool indeed. How would you update extension apps in this environment?

Thank you for sharing. Dokploy looks like an awesome tool! But did anyone figured out how to install with several apps? I need Health app and Payments added. I built custom image and pushed to Docker Hub, I tried installing changing image and version in environment to custom, and also tried making changes to Create_Site in composer but can’t install properly. It’s either doesn’t work at all or skips apps install and just installs bare Frappe framework. Any advice or guide? Thank you!

Do exactly as @shoob described, pay attention to the apps’ release tag and compatibility with other elements when building a custom image.

I might be wrong, we should consult with experts, but it might be beneficial to change environment settings to CREATE_SITE=0 and CONFIGURE=0 after the initial deployment for future updates and redeployment if you want to preserve data.

1 Like