What is the best practice for auto create new site?

Hi Guys,

Currently I’m working on the feature that let user create a new site, for example: user provide the DNS, site password, site name then the system will create a new site for them

As I see, Frappe framework has the Command module and there are site commands too.
I also know that to use the multi-tenant with multi-DNS I also need to reload the NGINX service too.
I’m thinking of using the frappe_docker,

So what is the best practice I can use in this case ?
I’m thinking about using the Frappe Command module for creating site, then bind-mount the Docker daemon to my container so that I can use the Docker command to force reload the Nginx service in Nginx container. Is this possible to achieve what I want ?

Use frappecloud.com as your backend. Or have a look at bench manager: Bench Manager

1 Like

If your objective is to add sites without nginx reload then it can be done even now.

The erpnext-nginx container on its own accepts all hostnames instead of specific sites like the bench setup does.

As long as the name resolves to the container the site can be served. That means no need to restart erpnext-nginx containers after adding sites.

You just need to direct requests at the level of nginxproxymanager/traefik/ingress.

if you prefer traefik, the cert and domain name management can be dynamic and labels based, that requires no restarts.

if you prefer nginx,

1 Like

Thank you very much. Really appreciated for your support

Thank you very much, the Bench Manager seem pretty good for my case. I will try