diff --git a/bxl-rpi/apps/docker-compose.invoice.yaml b/bxl-rpi/apps/docker-compose.invoice.yaml new file mode 100644 index 0000000..28e3254 --- /dev/null +++ b/bxl-rpi/apps/docker-compose.invoice.yaml @@ -0,0 +1,54 @@ +services: + invoicenginx: + container_name: invoice_nginx + image: nginx:latest + restart: on-failure + volumes: + - $CONFIG/invoiceninja/in-vhost.conf:/etc/nginx/conf.d/in-vhost.conf:ro + - $DATA/invoiceninja/public:/var/www/app/public:ro + environment: + - TRUSTED_PROXIES='*' + depends_on: + - invoiceninja + networks: + - invoice + - external + labels: + - "traefik.enable=true" + - "traefik.http.routers.invoice.rule=Host(`invoice.bhasher.com`)" + - "traefik.http.services.invoice.loadbalancer.server.port=80" + - "traefik.http.routers.invoice.tls=true" + - "traefik.http.routers.invoice.tls.certresolver=http" + - "traefik.http.routers.invoice.entrypoints=internalsecure" + + invoiceninja: + image: invoiceninja/invoiceninja:5 + container_name: invoice_ninja + environment: + - APP_URL=https://invoice.bhasher.com + - APP_KEY=${INVOICENINJA_APIKEY} + - REQUIRE_HTTPS=true + - PHANTOMJS_PDF_GENERATION=false + - PDF_GENERATOR=snappdf + - QUEUE_CONNECTION=database + - DB_HOST=mariadb + - DB_DATABASE=invoiceninja + - DB_USERNAME=root + - DB_PASSWORD=${MARIADB_ROOT} + - IN_USER_EMAIL=invoice@bhasher.com + - IN_PASSWORD=${INVOICENINJA_PASSWORD} + - TRUSTED_PROXIES='*' + restart: unless-stopped + volumes: + - $DATA/invoiceninja/public:/var/www/app/public:rw + - $DATA/invoiceninja/storage:/var/www/app/storage:rw + networks: + - invoice + - storage + +networks: + invoice: + external: + external: true + storage: + external: true diff --git a/bxl-rpi/config/invoiceninja/in-vhost.conf b/bxl-rpi/config/invoiceninja/in-vhost.conf new file mode 100644 index 0000000..cce2ea7 --- /dev/null +++ b/bxl-rpi/config/invoiceninja/in-vhost.conf @@ -0,0 +1,28 @@ +server { + listen 80 default_server; + server_name _; + + client_max_body_size 100M; + + root /var/www/app/public/; + index index.php; + + location / { + try_files $uri $uri/ /index.php?$query_string; + } + + location = /favicon.ico { access_log off; log_not_found off; } + location = /robots.txt { access_log off; log_not_found off; } + + location ~ \.php$ { + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass invoiceninja:9000; + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_intercept_errors off; + fastcgi_buffer_size 16k; + fastcgi_buffers 4 16k; + } +} + diff --git a/bxl-rpi/system/docker-compose.storage.yaml b/bxl-rpi/system/docker-compose.storage.yaml index e6b3157..412e131 100644 --- a/bxl-rpi/system/docker-compose.storage.yaml +++ b/bxl-rpi/system/docker-compose.storage.yaml @@ -18,6 +18,18 @@ services: networks: - storage + mariadb: + container_name: mariadb + image: mariadb:latest + restart: on-failure + environment: + - MARIADB_ROOT_PASSWORD=${MARIADB_ROOT} + volumes: + - $DATA/mariadb:/var/lib/mysql:rw + networks: + - storage + + networks: storage: name: storage