Dear community,
I am hosting IN myself on my QNAP NAS using the official docker files from github. And I can access it only with the local IP address: http://192.168.178.75. But I want to achieve the following:
Use a new port, instead of 80. Example:8003
I want to reach IN with the host name as long as im in the LAN: http://in.localhost:8003, using any device in the network.
In the near future make it available with my subdomain name: in.mydomainname.com
I cannot achieve 1) and 2) despite multiple attempts. I am totally confused at the configuration options:
a) extra_hosts: The official docker compose contains the following definitions under the extra_hosts for all the services: in5.localhost:192.168.0.124. I changed them to in.localhost:192.168.178.75
Can someone please explain the use of these fields and how to confiure/adapt these fields to be able to reach IN with the url: http://in.localhost:8003 ?
I believe once I can acheive 1) and 2), doing 3) will be straight forward. Editing the DNS settings of my hosting provider and port forwarding in my router. Am i correct ?
To change the port open the docker-compose.yml and under the nginx service change the port:
ports:
- "8003:80"
Then docker-compose up -d to update the changes.
If you want to reach InvoiceNinja, which is running on your NAS, from any device in the same network using a hostname, you need to use the hostname of your NAS, and it needs to be resolvable using DNS. Otherwise there is no way for other devices on the network to know which IP to look for. Fortunately, nowadays many devices register itself using mDNS. To see if this is the case for your NAS, get its hostname (try hostname in a shell) and add .local to it if it doesn’t end with that already.
Then try: http://my-nas.local:8003. Make sure to update your APP_URL.
Hi Patrick,
Thanks for the quick reply. The one about mDNS is very helpful. I can now access using the hostname instead of the IP.
Do you perhaps know what and how should the extra_hosts field be configured ? I know that would actually add an entry in the /etc/hosts file of the container. But what is it for ?
I need to replace in.localhost:8003 manually to reach the link or download the PDF. In which portion should I change to fix this? docker-compose.yml file? host? in-vhost?