most important configuration here is root directory and invoice ninja service name.
in case IN container restart it gets new ip every time nginx need to get new ip but it crash. using set/variable will prevent nginx crash.
testninja.domain.tld: for testing new version and to allow employees play with so they don't clutter production db with fake client and invoices. most important recurring invoices playground they can fill db with 1000's invoices for no reason.
Most config are same so posting changes only from above.
that's it now you can have two separate parallel IN on different subdomain.
little more about my setup
I have docker swarm with 3 vps and for persistent storage using glusterfs. managing docker cluster with portainer and swarmpit (very useful to get logs from all replicated services across cluster) .
caddy-docker-proxy helps in auto creating caddy config and updating ip for nginx service. their is some learning time but it save way more than you ever imagine.
caddy-tlsconsul save all tls certificate to consul so they can be accessed by every caddy server across cluster.
this is my first working caddy docker compose in order to use please create your caddy docker image.
Target : Run multiple IN version with different database, public/storage directory on different subdomain/domain behind caddy (auto ssl).
requirement Mysql/MariaDB Caddy external ip of host server for example 2.2.2.2
multiple Nginx are used to keep public directory of each IN different.
these configuration is for docker swarm mode so might need little changes for normal docker mode.
invoice.domain.tld: for production use always online and only upgrade Friday after backup.
in-vhost.conf
most important configuration here is root directory and invoice ninja service name. in case IN container restart it gets new ip every time nginx need to get new ip but it crash. using set/variable will prevent nginx crash.
hosts
domain and external ip.
2.2.2.2 invoice.domain.tld
Caddy Config
need to add nginx service ip or name.
testninja.domain.tld: for testing new version and to allow employees play with so they don't clutter production db with fake client and invoices. most important recurring invoices playground they can fill db with 1000's invoices for no reason.
Most config are same so posting changes only from above.
in-vhost.conf
hosts
2.2.2.2 testninja.domain.tld
Caddy Config
that's it now you can have two separate parallel IN on different subdomain.
little more about my setup
I have docker swarm with 3 vps and for persistent storage using glusterfs. managing docker cluster with portainer and swarmpit (very useful to get logs from all replicated services across cluster) .
I have custom caddy working with consul.
https://github.com/lucaslorentz/caddy-docker-proxy https://github.com/pteich/caddy-tlsconsul
caddy-docker-proxy helps in auto creating caddy config and updating ip for nginx service. their is some learning time but it save way more than you ever imagine. caddy-tlsconsul save all tls certificate to consul so they can be accessed by every caddy server across cluster.
this is my first working caddy docker compose in order to use please create your caddy docker image.
for reference
https://invoiceninja.slack.com/archives/C01N3QKA6JY/p1620675425040300