is this just not a good idea? Referencing:
https://devops.stackexchange.com/q/12762/23443
I’m trying to understand why, if I want to run ERPnext so that it’s available on localhost docker isn’t a good fit. Or at least, seemingly, requires configuration of traefik, as well as additional configurations.
Just looking for an overview of the problems here.
In case of production docker setup, it is configured to use dns multi tenancy:
https://frappeframework.com/docs/user/en/bench/guides/setup-multitenancy#dns-based-multitenancy
It needs Host or X-Frappe-Site-Name header to serve the site from multi tenant bench.
Try,
curl -H "Host: site.name" http://localhost
response.headers.extend(frappe.local.rate_limiter.headers())
frappe.destroy()
return response
def init_request(request):
frappe.local.request = request
frappe.local.is_ajax = frappe.get_request_header("X-Requested-With")=="XMLHttpRequest"
site = _site or request.headers.get('X-Frappe-Site-Name') or get_site_name(request.host)
frappe.init(site=site, sites_path=_sites_path)
if not (frappe.local.conf and frappe.local.conf.db_name):
# site does not exist
raise NotFound
if frappe.local.conf.get('maintenance_mode'):
frappe.connect()
raise frappe.SessionStopped('Session Stopped')
Traefik can be configured to pass these headers to erpnext.
1 Like