DNS based setup in Docker environment for multitenancy

I setup two sites site1.example.com and site2.example.com on bare metal servers. using DNS based multitenancy and NGINX successfully.

When I was trying to achieve this same setup using docker & easy-install (frappe_docker), I’m stuck & don’t know how to achieve it?

After running easy install with the following commands

wget https://raw.githubusercontent.com/frappe/bench/develop/easy-install.py
python3 easy-install.py --prod --email <myname@example.com> --sitename <site1.example.com>

Docker and it’s containers are running, site1.example.com site is up and running too.

Then I tweaked frappe-compose.yml file to add another site

labels:
      traefik.enable: "true"
      traefik.http.routers.frontend-http.entrypoints: websecure
  ->  traefik.http.routers.frontend-http.rule: Host(`site1.example.com`, `site2.example.com`)
      traefik.http.routers.frontend-http.tls.certresolver: main-resolver
      traefik.http.services.frontend.loadbalancer.server.port: "8080"

Ran the following command for site2

python3 easy-install.py --prod --email <myname@example.com> --sitename <site2.example.com>

Now my both sites are accessible from browser.

But both sites are sharing common frappe/apps folder.

At this point I don’t know how to add the additional sites while keeping those sites folders seprately.

easy-install.py will not support multisite.

1 Like

Thanks

1 Like

Hi @mmwaseem, May I know How did you achieve this, Do you have any documentations for that if yes please share, It’d really be helpful
Thanks

By following this tutorial & the related chapters in the documentation I was able to setup DNS based multitenancy:

https://frappeframework.com/docs/user/en/bench/guides/setup-multitenancy

Along with the installation of NGINX, Supervisor & Let’s Encrypt.

1 Like