Docker Compose with Caddy - invoiceninja/dockerfiles GitHub Wiki
â ī¸ The following guides aims at a completely fresh install of Invoice Ninja with the Caddy webserver. The is no migration scenario covered.
We especially provide and enforce a TLS setup here, as Caddy comes with automatic HTTPS. If you do not want this or have an already working setup with TLS then this setup might not be the right choice for you.
Table of content
- Guide for Invoice Ninja 4
- Guide for Invoice Ninja 5
Prerequisites
âšī¸ Read the prerequisites section carefully as you need all of these information for a proper setup.
Additionally you need to have proper TLD (Top Level Domain) on a server that is publicly reachable (with a public IP). This is necessary for Caddy to correctly obtain the TLS certificate. Also check the Caddy automatic https requirements.
â ī¸ If you are missing either one of these additional prerequisites, then this setup does not work for you. Please check the setup with nginx instead.
Even if not preferred, you can also use https://localhost
to run IN. With that you only get a self-signed certificate and issues in your browser. Make sure you know the risk and consequences and how to tackle them.
Guide for Invoice Ninja 4
đ Create a new folder
First we need an empty folder where our docker files for IN 4 will reside.
Command: mkdir ~/invoiceninja4; cd ~/invoiceninja4
đģ Clone this repository
Now we need to clone this repository to get all the files necessary to corretctly configure and run IN 4 with Docker Compose.
Command: git clone https://github.com/invoiceninja/dockerfiles.git .
đ¨ Configure your installation
To get the complete overview what things can be configured please check the docker-compose.yml
. Each section and value that can or should be configured is commented.
Things you definately should check and change:
APP_URL
: Environment variable where to reach your installation. This should be your valid TLD domain.- Ports: Ports are configured for
80
and443
. Make sure they are open and not blocked by some other service. - Image: Set this to
invoiceninja/invoiceninja:alpine-4
to get the most recent version of IN 4 - Database settings: You can find the default settings in the
docker-compose.yml
file at the db service. So for theapp
service the environment variables that should be added are:DB_HOST
=dbDB_USERNAME
=ninjaDB_PASSWORD
=ninjaDB_DATABASE
=db-ninja-01
đ Run your installation
After you finished the afore mentioned steps you can now run your installation.
Command: docker-compose up -d
This will run Invoice Ninja 4 with the configuration made. You should now be able to reach your installation at the APP_URL
configured.
Guide for Invoice Ninja 5
đ Create a new folder
First we need an empty folder where our docker files for IN 5 will reside.
Command: mkdir ~/invoiceninja5; cd ~/invoiceninja5
đģ Clone this repository
Now we need to clone this repository to get all the files necessary to corretctly configure and run IN 5 with Docker Compose.
Command: git clone https://github.com/invoiceninja/dockerfiles.git .
đ¨ Configure your installation
To get the complete overview what things can be configured please check the docker-compose.yml
. Each section and value that can or should be configured is commented.
Things you definately should check and change:
APP_URL
: Environment variable where to reach your installation. This should be your valid TLD domain.- Ports: Ports are configured for
80
and443
. Make sure they are open and not blocked by some other service.
đ Run your installation
After you finished the afore mentioned steps you can now run your installation.
Command: docker-compose up -d
This will run Invoice Ninja 5 with the configuration made. You should now be able to reach your installation at the APP_URL
configured.