I’ve not installed ERPNext inside docker on a vm to be accessed from LAN.
General points to consider.
Only Dns multi tenancy is available in docker.
Site names resolve to sites created, ip won’t serve sites
if it’s single machine trying to resolve site, edit /etc/hosts file for that machine.
if machines from lan want to access the site, setup local DNS server, map the ip with custom domain and use that dns server from all machines trying to access ERPNext site.
I’ve not done this myself, so can’t know what can go wrong.
In Virtualbox I have to right click vm, settings > Network > Advance > Port Forwarding
and add host and guest ports, after that I am able to access ports from virtualbox vm on my laptop.
Well… is not the hyper V the problem… the problem is inside the VM. I am asking how can I redirect someone who access my local ip at 80 port to the docker container(or to host of erp) ?
You can us iptables (google iptables forward host port 80 to container)… If your use case is not for a large scape deployment, perhaps you should reconsider whether you want to deploy with docker… if your host is an Ubuntu VM - and you need containerization, consider using lxd instead. lxd installs easily via snap and the resultant container is like a linux vm in which you can use all the std bench commands, etc, - for which you will find lot of help on this forum… just my two cents.
Hi! Thanks for advice, but I would like to deploy ERP with Docker. It is really strange what is happening… I can access ERP from http://localhost from inside of VM but when I try to access 192.168.x.x (the local ip of VM) i get this 404 page not found error page:
This means the url you enter in browser is treated as sitename.
If you enter http://localhost then there should be a site called “localhost” instead of “mysite.localhost” or “example.com”. Same applies with http://192.168.x.x
This configuration sets default site for the deployment.
traefik labels: these tell all the incoming requests to be reverse proxied to erpnext-nginx container and also sets the Host header to erpnext-nginx.
erpnext-nginx container gets host header as erpnext-nginx irrespective of any site input in request and serves the site mentioned in currentsite.txt, erpnext-nginx