invoiceninja / dockerfiles

Docker files for Invoice Ninja
https://hub.docker.com/r/invoiceninja/invoiceninja
GNU General Public License v2.0
419 stars 268 forks source link

Add Traefik examples #510

Open Xenion1987 opened 1 year ago

Xenion1987 commented 1 year ago

Hi @turbo124 and @lwj5

Related to #506 and #509, what can I (we) do to add the example files for using Traefik Proxy?

In my PR #506, I've made some changes to the docker-compose-files:

  1. I removed the default network and port from the docker-compose.yml and moved it to a docker-compose.override.yml. The idea was to make possible customizations clearer for those who might not be too familiar with Docker. Additionally, this way you could make the templates from ./config/*/ easier to use with predefined docker-compose.override.yml files.
  2. I've added a second internal network for the communication between the InvoiceNinja app and database - by default there should be no need the database to be able to reach "the internet".

My PR was reverted because of a possible broken git pull for those who already have their own docker-compose.override.yml in use. In itself I can understand the reason. The question now is how I could merge the traefik examples. The only way I can think of off the top of my head would be to maintain a completely separate docker-compose.yml file in the folder ./config/traefik in addition to the original docker-compose.yml file.


Another suggested change is in the env file. There I have split the variable APP_URL into three more finely granulated variables, which will be merged into the productive variable APP_URL at the end:

LINK

## IN application vars
# http or https
APP_URL_SCHEME=http
# Domain name you want to use for InvoiceNinja
APP_URL_DOMAIN=in.localhost
# Port where InvoiceNinja should listen on
APP_URL_PORT=8003

## Example https variables:
# APP_URL_SCHEME=https
# APP_URL_DOMAIN=ninja.domain.tld
# APP_URL_PORT=443
# REQUIRE_HTTPS=true

# This variable should not be modified, except you know what you do
APP_URL="${APP_URL_SCHEME:-http}://${APP_URL_DOMAIN:-in.localhost}:${APP_URL_PORT:-8003}"
(...)

What do you think about this adjustment?

turbo124 commented 1 year ago

@Xenion1987

I'll default to @lwj5 as he is the expert in this arena.

If it can't be included in the main repo, I am more than happy to create a separate branch for the traefik specific docker-compose.yml file and reference it in the README.

Xenion1987 commented 1 year ago

If it won't fit into this repo, maybe it could be maintained in the forum and mentioned in the Readme.

lwj5 commented 1 year ago

I think it's ok for the Traefik example to live in this repo.

Changes to be made

lwj5 commented 1 year ago

I've summarized the changes in the post above. Just create another PR with the changes and I'll take a look at it asap

turbo124 commented 1 year ago

@Xenion1987 @lwj5 just to clarify, the example could certainly exist in the repo, just in its own branch.

Xenion1987 commented 1 year ago

Hey there,

I hopefully can give an update about this issue over the weekend.