From d2df0bb3c5b5886704166d4f489e56f7dcd2bd86 Mon Sep 17 00:00:00 2001 From: Asen Lekov Date: Thu, 16 May 2024 21:17:59 +0300 Subject: [PATCH 1/2] fix(invoice-ninja): broken compose project --- .../data/nginx/invoice-ninja.conf | 2 +- apps/invoice-ninja/docker-compose.yml | 93 +++++++++---------- 2 files changed, 43 insertions(+), 52 deletions(-) diff --git a/apps/invoice-ninja/data/nginx/invoice-ninja.conf b/apps/invoice-ninja/data/nginx/invoice-ninja.conf index d464ed55..e2808145 100644 --- a/apps/invoice-ninja/data/nginx/invoice-ninja.conf +++ b/apps/invoice-ninja/data/nginx/invoice-ninja.conf @@ -25,7 +25,7 @@ server { location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_pass invoice-ninja-server:9000; + fastcgi_pass invoice-ninja:9000; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; diff --git a/apps/invoice-ninja/docker-compose.yml b/apps/invoice-ninja/docker-compose.yml index 4b0d0db3..45c771a9 100644 --- a/apps/invoice-ninja/docker-compose.yml +++ b/apps/invoice-ninja/docker-compose.yml @@ -1,6 +1,44 @@ -version: "3.9" - services: + invoice-ninja-web: + image: nginx:1.25 + container_name: invoice-ninja-web + restart: unless-stopped + volumes: + - ${APP_DATA_DIR}/data/nginx/invoice-ninja.conf:/etc/nginx/conf.d/default.conf:ro + - ${APP_DATA_DIR}/data/public:/var/www/app/public:ro + depends_on: + invoice-ninja: + condition: service_started + ports: + - ${APP_PORT}:80 + networks: + - tipi_main_network + labels: + # Main + traefik.enable: true + traefik.http.middlewares.invoice-ninja-web-redirect.redirectscheme.scheme: https + traefik.http.services.invoice-ninja.loadbalancer.server.port: 80 + # Web + traefik.http.routers.invoice-ninja-web-insecure.rule: Host(`${APP_DOMAIN}`) + traefik.http.routers.invoice-ninja-web-insecure.entrypoints: web + traefik.http.routers.invoice-ninja-web-insecure.service: invoice-ninja-web + traefik.http.routers.invoice-ninja-web-insecure.middlewares: invoice-ninja-web-redirect + # Websecure + traefik.http.routers.invoice-ninja-web.rule: Host(`${APP_DOMAIN}`) + traefik.http.routers.invoice-ninja-web.entrypoints: websecure + traefik.http.routers.invoice-ninja-web.service: invoice-ninja-web + traefik.http.routers.invoice-ninja-web.tls.certresolver: myresolver + # Local domain + traefik.http.routers.invoice-ninja-web-local-insecure.rule: Host(`invoice-ninja.${LOCAL_DOMAIN}`) + traefik.http.routers.invoice-ninja-web-local-insecure.entrypoints: web + traefik.http.routers.invoice-ninja-web-local-insecure.service: invoice-ninja-web + traefik.http.routers.invoice-ninja-web-local-insecure.middlewares: invoice-ninja-web-redirect + # Local domain secure + traefik.http.routers.invoice-ninja-web-local.rule: Host(`invoice-ninja.${LOCAL_DOMAIN}`) + traefik.http.routers.invoice-ninja-web-local.entrypoints: websecure + traefik.http.routers.invoice-ninja-web-local.service: invoice-ninja-web + traefik.http.routers.invoice-ninja-web-local.tls: true + invoice-ninja: image: invoiceninja/invoiceninja:5.8.54 container_name: invoice-ninja @@ -9,7 +47,7 @@ services: environment: - IN_USER_EMAIL=${INVOICE_NINJA_USER_MAIL} - IN_PASSWORD=${INVOICE_NINJA_USER_PASSWORD} - - APP_URL=http://invoice-ninja + - APP_URL=http://invoice-ninja-web - APP_KEY=${INVOICE_NINJA_APP_KEY} - APP_CIPHER=AES-256-CBC - DB_HOST=invoice-ninja-db @@ -31,46 +69,6 @@ services: networks: - tipi_main_network - invoice-ninja-web: - image: nginx:1.25 - container_name: invoice-ninja-web - restart: unless-stopped - volumes: - - ${APP_DATA_DIR}/data/nginx/invoice-ninja.conf:/etc/nginx/conf.d/default.conf:ro - - ${APP_DATA_DIR}/data/public:/var/www/app/public:ro - depends_on: - invoice-ninja-server: - condition: service_started - ports: - - ${APP_PORT}:80 - networks: - - tipi_main_network - labels: - # Main - traefik.enable: true - traefik.http.middlewares.invoice-ninja-web-redirect.redirectscheme.scheme: https - traefik.http.services.invoice-ninja.loadbalancer.server.port: 80 - # Web - traefik.http.routers.invoice-ninja-insecure.rule: Host(`${APP_DOMAIN}`) - traefik.http.routers.invoice-ninja-insecure.entrypoints: web - traefik.http.routers.invoice-ninja-insecure.service: invoice-ninja - traefik.http.routers.invoice-ninja-insecure.middlewares: invoice-ninja-web-redirect - # Websecure - traefik.http.routers.invoice-ninja.rule: Host(`${APP_DOMAIN}`) - traefik.http.routers.invoice-ninja.entrypoints: websecure - traefik.http.routers.invoice-ninja.service: invoice-ninja - traefik.http.routers.invoice-ninja.tls.certresolver: myresolver - # Local domain - traefik.http.routers.invoice-ninja-local-insecure.rule: Host(`invoice-ninja.${LOCAL_DOMAIN}`) - traefik.http.routers.invoice-ninja-local-insecure.entrypoints: web - traefik.http.routers.invoice-ninja-local-insecure.service: invoice-ninja - traefik.http.routers.invoice-ninja-local-insecure.middlewares: invoice-ninja-web-redirect - # Local domain secure - traefik.http.routers.invoice-ninja-local.rule: Host(`invoice-ninja.${LOCAL_DOMAIN}`) - traefik.http.routers.invoice-ninja-local.entrypoints: websecure - traefik.http.routers.invoice-ninja-local.service: invoice-ninja - traefik.http.routers.invoice-ninja-local.tls: true - invoice-ninja-db: image: mariadb:10.4 container_name: invoice-ninja-db @@ -88,14 +86,7 @@ services: invoice-ninja-init: condition: service_completed_successfully healthcheck: - test: - [ - "CMD", - "healthcheck.sh", - "--su-mysql", - "--connect", - "--innodb_initialized", - ] + test: [ "CMD", "healthcheck.sh", "--su-mysql", "--connect", "--innodb_initialized" ] interval: 10s timeout: 5s retries: 5 From 629a5f7b56156d4d5181e12b4f24c40a68b1bd34 Mon Sep 17 00:00:00 2001 From: Nicolas Meienberger Date: Sun, 19 May 2024 14:06:24 +0200 Subject: [PATCH 2/2] chore(invoice-ninja): bump version --- apps/invoice-ninja/config.json | 7 +-- apps/invoice-ninja/docker-compose.yml | 62 +++++++++++++-------------- 2 files changed, 33 insertions(+), 36 deletions(-) diff --git a/apps/invoice-ninja/config.json b/apps/invoice-ninja/config.json index afb9c331..df14b767 100644 --- a/apps/invoice-ninja/config.json +++ b/apps/invoice-ninja/config.json @@ -5,7 +5,7 @@ "available": true, "exposable": true, "id": "invoice-ninja", - "tipi_version": 1, + "tipi_version": 2, "version": "5.8.54", "categories": ["finance"], "description": "Invoice Ninja is an invoicing application which makes sending invoices and receiving payments simple and easy. Our latest version is a clean slate rewrite of our popular invoicing application which builds on the existing feature set and adds a wide range of features and enhancements the community has asked for.", @@ -38,8 +38,5 @@ "env_variable": "INVOICE_NINJA_APP_KEY" } ], - "supported_architectures": [ - "arm64", - "amd64" - ] + "supported_architectures": ["arm64", "amd64"] } diff --git a/apps/invoice-ninja/docker-compose.yml b/apps/invoice-ninja/docker-compose.yml index 45c771a9..fd332aaa 100644 --- a/apps/invoice-ninja/docker-compose.yml +++ b/apps/invoice-ninja/docker-compose.yml @@ -1,4 +1,34 @@ services: + invoice-ninja: + image: invoiceninja/invoiceninja:5.8.54 + container_name: invoice-ninja + restart: unless-stopped + user: 1500:1500 + environment: + - IN_USER_EMAIL=${INVOICE_NINJA_USER_MAIL} + - IN_PASSWORD=${INVOICE_NINJA_USER_PASSWORD} + - APP_URL=http://invoice-ninja-web + - APP_KEY=${INVOICE_NINJA_APP_KEY} + - APP_CIPHER=AES-256-CBC + - DB_HOST=invoice-ninja-db + - DB_PORT=3306 + - DB_DATABASE=ninja + - DB_USERNAME=ninja + - DB_PASSWORD=ninja + - REQUIRE_HTTPS=false + - QUEUE_CONNECTION=database + - IS_DOCKER=TRUE + volumes: + - ${APP_DATA_DIR}/data/public:/var/www/app/public:rw,delegated + - ${APP_DATA_DIR}/data/storage:/var/www/app/storage:rw,delegated + - ${APP_DATA_DIR}/data/php/php.ini:/usr/local/etc/php/php.ini:ro + - ${APP_DATA_DIR}/data/php/php-cli.ini:/usr/local/etc/php/php-cli.ini:ro + depends_on: + invoice-ninja-db: + condition: service_healthy + networks: + - tipi_main_network + invoice-ninja-web: image: nginx:1.25 container_name: invoice-ninja-web @@ -39,36 +69,6 @@ services: traefik.http.routers.invoice-ninja-web-local.service: invoice-ninja-web traefik.http.routers.invoice-ninja-web-local.tls: true - invoice-ninja: - image: invoiceninja/invoiceninja:5.8.54 - container_name: invoice-ninja - restart: unless-stopped - user: 1500:1500 - environment: - - IN_USER_EMAIL=${INVOICE_NINJA_USER_MAIL} - - IN_PASSWORD=${INVOICE_NINJA_USER_PASSWORD} - - APP_URL=http://invoice-ninja-web - - APP_KEY=${INVOICE_NINJA_APP_KEY} - - APP_CIPHER=AES-256-CBC - - DB_HOST=invoice-ninja-db - - DB_PORT=3306 - - DB_DATABASE=ninja - - DB_USERNAME=ninja - - DB_PASSWORD=ninja - - REQUIRE_HTTPS=false - - QUEUE_CONNECTION=database - - IS_DOCKER=TRUE - volumes: - - ${APP_DATA_DIR}/data/public:/var/www/app/public:rw,delegated - - ${APP_DATA_DIR}/data/storage:/var/www/app/storage:rw,delegated - - ${APP_DATA_DIR}/data/php/php.ini:/usr/local/etc/php/php.ini:ro - - ${APP_DATA_DIR}/data/php/php-cli.ini:/usr/local/etc/php/php-cli.ini:ro - depends_on: - invoice-ninja-db: - condition: service_healthy - networks: - - tipi_main_network - invoice-ninja-db: image: mariadb:10.4 container_name: invoice-ninja-db @@ -86,7 +86,7 @@ services: invoice-ninja-init: condition: service_completed_successfully healthcheck: - test: [ "CMD", "healthcheck.sh", "--su-mysql", "--connect", "--innodb_initialized" ] + test: ['CMD', 'healthcheck.sh', '--su-mysql', '--connect', '--innodb_initialized'] interval: 10s timeout: 5s retries: 5