Compare commits

...

232 Commits

Author SHA1 Message Date
David Bomba
b599ca5905 Merge pull request #845 from Thulium-Drake/fix_init
Ensure that the target folder is present before copying files into it
2025-12-28 09:50:53 +11:00
Jeffrey van Pelt
d222163f82 Fix syntax to match other folders 2025-12-24 13:04:50 +01:00
Jeffrey van Pelt
d81eb48e55 Ensure that the target folder is present before copying files into it 2025-12-20 12:11:55 +01:00
David Bomba
a7f9ed049c Merge pull request #844 from benbrummer/debian
Change mv to cp for public folder update
2025-12-19 22:19:47 +11:00
benbrummer
aec886c9eb Fix rm command to remove all files in public folder
Signed-off-by: benbrummer <info@benjamin-brummer.de>
2025-12-18 16:07:16 +01:00
benbrummer
84efa573f0 Change mv to cp for public folder update
Replaced mv command with cp for copying files to public folder and added cleanup of temporary public files. This is a robust alternative to mv for e.g ZFS and docker overlay2

Signed-off-by: benbrummer <info@benjamin-brummer.de>
2025-12-18 16:00:21 +01:00
David Bomba
849fc2365d Merge pull request #841 from turbo124/debian
Set default memory limit
2025-12-18 09:08:25 +11:00
David Bomba
adfa143861 Set default memory limit 2025-12-18 09:07:30 +11:00
David Bomba
b80e842ad7 Merge pull request #832 from benbrummer/debian
unicode emoji for dockerhub
2025-11-05 09:46:05 +11:00
Benjamin Brummer
f8550e7e0d unicode emoji 2025-11-04 14:08:55 +01:00
David Bomba
f775866abf Merge pull request #831 from turbo124/debian
Fixes for release for debian/octane
2025-11-04 10:00:42 +11:00
David Bomba
85fad200a0 Fixes for release for debian/octane 2025-11-04 09:59:10 +11:00
David Bomba
16022da2ac Merge pull request #829 from benbrummer/debian
url as argument
2025-10-30 06:57:57 +11:00
Benjamin Brummer
40817ae28c move chown to next stage 2025-10-29 14:16:12 +01:00
Benjamin Brummer
af5e8d6b4f remove duplicate line 2025-10-29 13:49:25 +01:00
Benjamin Brummer
cf822e0de9 url as argument 2025-10-29 13:38:29 +01:00
Benjamin Brummer
79dde723bd ADD sets rw only for root 2025-10-29 08:33:47 +01:00
David Bomba
c90298d29c Merge pull request #823 from TheNewSound/patch-2
Update Dockerfile to use ADD for downloading files, instead of RUN curl
2025-10-29 16:28:18 +11:00
David Bomba
b9ba364665 Merge pull request #826 from benbrummer/debian
Fix build workflow
2025-10-29 10:53:15 +11:00
Benjamin Brummer
77807f94f4 cleanup workflow 2025-10-28 15:01:47 +01:00
Benjamin Brummer
854b104915 Update badges 2025-10-28 14:54:05 +01:00
TheNewSound
192c59d596 Remove --chown and rm from Dockerfile
Signed-off-by: TheNewSound <info@worldwidecrap.nl>
2025-10-28 09:01:47 +01:00
Benjamin Brummer
fc6d89b9ef Cleanup 2025-10-28 08:57:58 +01:00
Benjamin Brummer
b572bccd0e no push and merge 2025-10-28 08:44:59 +01:00
Benjamin Brummer
b9bef3e436 update triggers to run for changes in .github 2025-10-28 08:38:06 +01:00
Benjamin Brummer
475335244f Secrets are not available for pull requests from a fork 2025-10-28 08:25:52 +01:00
TheNewSound
0a774f9283 Use --chown in Dockerfile to set permissions
Signed-off-by: TheNewSound <info@worldwidecrap.nl>
2025-10-27 23:35:10 +01:00
TheNewSound
d639f649a3 Modify tar command in Dockerfile
Removed strip-components option from tar command.

Signed-off-by: TheNewSound <info@worldwidecrap.nl>
2025-10-27 16:54:22 +01:00
TheNewSound
b40a60a12d Fix ownership command for invoiceninja tarball
Signed-off-by: TheNewSound <info@worldwidecrap.nl>
2025-10-27 16:48:15 +01:00
TheNewSound
e1ed2f0eab Update Dockerfile
Fix permissions of downloaded tar.gz file via ADD

Signed-off-by: TheNewSound <info@worldwidecrap.nl>
2025-10-27 16:39:04 +01:00
TheNewSound
f9d8cf1fee Update Dockerfile to use ADD for downloading files
Replaced curl command with ADD instruction for downloading Invoice Ninja instead of RUN curl.

Signed-off-by: TheNewSound <info@worldwidecrap.nl>
2025-10-27 13:48:26 +01:00
David Bomba
7ab9653a2a Merge pull request #821 from benbrummer/debian
Correct minor version formatting in publish-image.yaml
2025-10-22 07:49:09 +11:00
benbrummer
82a9c8ae19 Correct minor version formatting in publish-image.yaml
Fix formatting of minor version in image tags.

Signed-off-by: benbrummer <info@benjamin-brummer.de>
2025-10-21 13:56:47 +02:00
David Bomba
182b600da3 Merge pull request #820 from benbrummer/debian
TAGS without REGISTRY_IMAGE
2025-10-21 18:09:14 +11:00
Benjamin Brummer
279bb447a5 separate version job with outputs for tags 2025-10-21 09:02:16 +02:00
Benjamin Brummer
f6173f458b TAGS without REGISTRY_IMAGE 2025-10-21 08:33:44 +02:00
David Bomba
c000f42e61 Merge pull request #819 from benbrummer/debian
Rename secret
2025-10-21 07:20:28 +11:00
benbrummer
c348f92aa9 rename secret 2025-10-20 22:11:31 +02:00
benbrummer
d8d8415771 Rename secret 2025-10-20 22:07:35 +02:00
David Bomba
f897dc3b2d Merge pull request #818 from benbrummer/debian
manifest creation for multiple runners
2025-10-21 06:55:23 +11:00
Benjamin Brummer
98f60d721c multiple runner publish 2025-10-20 21:45:11 +02:00
benbrummer
ea252c7891 multiple runner build 2025-10-20 21:01:35 +02:00
Benjamin Brummer
abeae7fb64 Publish manifest for multiple runners 2025-10-20 10:33:37 +02:00
Benjamin Brummer
fbb4bd29f7 handle digest 2025-10-20 10:31:21 +02:00
Benjamin Brummer
7bb84355df initial commit for manifest creation for multiple runners 2025-10-20 09:34:35 +02:00
David Bomba
3509d03cf5 Merge pull request #816 from benbrummer/debian
Compose file refactoring - Debian
2025-10-01 18:11:47 +10:00
Benjamin Brummer
3ea9b66fde Default timing configuration for healthcheck should be sufficient 2025-10-01 07:50:27 +02:00
Benjamin Brummer
15feba28e5 Let compose create the network for the stack 2025-10-01 07:23:58 +02:00
Benjamin Brummer
b1ee5a8e98 Use docker default logging configuration 2025-10-01 07:18:49 +02:00
benbrummer
daccb15073 Merge branch 'invoiceninja:debian' into debian 2025-09-30 13:40:41 +02:00
Benjamin Brummer
5970556335 Mounting .env file is redundant with env_file: 2025-09-30 13:20:39 +02:00
Benjamin Brummer
e1cf8751db Do not pass all variables into mysql container 2025-09-30 13:16:14 +02:00
David Bomba
1ef35c361c Merge pull request #814 from benbrummer/debian
Push README.md to DockerHub
2025-09-30 21:07:45 +10:00
Benjamin Brummer
47b370601c Push README.md to DockerHub 2025-09-30 12:56:53 +02:00
David Bomba
c72b175630 Merge pull request #812 from benbrummer/debian
Fix syntax error for cron
2025-09-30 18:55:22 +10:00
benbrummer
303c34665b Merge branch 'invoiceninja:debian' into debian 2025-09-30 10:53:31 +02:00
Benjamin Brummer
094762fcc1 fix cron 2025-09-30 10:52:12 +02:00
David Bomba
fac0ae1798 Merge pull request #811 from benbrummer/debian
Fix Unexpected input(s) 'stale-label', 'only-issues'
2025-09-30 18:51:53 +10:00
Benjamin Brummer
8eee7f9a1a Fix Unexpected input(s) 'stale-label', 'only-issues' 2025-09-30 10:45:16 +02:00
David Bomba
7238c8fab4 Merge pull request #808 from benbrummer/debian
Remove artisan package:discover
2025-09-30 07:07:28 +10:00
Benjamin Brummer
6e24faee43 matrix build with arm runners 2025-09-29 22:14:49 +02:00
Benjamin Brummer
1895f822f5 Update upgrade instructions 2025-09-29 14:12:35 +02:00
Benjamin Brummer
7a985b4d0d Remove redundant package discovery command from production setup 2025-09-29 14:06:41 +02:00
David Bomba
6c8a692c5e Merge pull request #805 from benbrummer/debian
Optimize artisan commands and add healthcheck as condition for app
2025-09-29 08:10:00 +10:00
Benjamin Brummer
91a2a106e0 Optimize artisan commands 2025-09-28 09:15:52 +02:00
Benjamin Brummer
7bd0a56260 Increase start-period, as initialization and migrations can take some time 2025-09-28 09:15:17 +02:00
Benjamin Brummer
32e59e289b Add healthcheck as condition for app 2025-09-26 15:17:44 +02:00
David Bomba
bafea492a9 Merge pull request #797 from benbrummer/debian
Create app/public
2025-09-09 07:31:56 +10:00
benbrummer
9a56657aa4 Create app/public
Signed-off-by: benbrummer <info@benjamin-brummer.de>
2025-09-08 16:41:17 +02:00
David Bomba
f36968c788 Merge pull request #792 from turbo124/debian
Rollback to 8.4
2025-09-03 07:27:56 +10:00
David Bomba
ee060b45fd Rollback to 8.4 2025-09-03 07:27:21 +10:00
David Bomba
430955d43f Merge pull request #790 from turbo124/debian
Roll back to PHP 8.3
2025-09-02 18:55:52 +10:00
David Bomba
abc66d2491 Roll back to PHP 8.3 2025-09-02 18:54:51 +10:00
David Bomba
d75b8e3616 Merge pull request #789 from benbrummer/debian
Workaround: Disable SSL for mariadb-client for compatibility with MySQL
2025-09-02 06:22:16 +10:00
benbrummer
085df042c1 Workaround: Disable SSL for mariadb-client for compatibility with MySQL 2025-09-01 21:36:45 +02:00
David Bomba
b67f49b9ba Merge pull request #784 from benbrummer/debian
HEALTHCHECK, mariadb-client and PHP 8.4
2025-08-29 22:02:27 +10:00
benbrummer
d1621f0fe5 PHP 8.4
Signed-off-by: benbrummer <info@benjamin-brummer.de>
2025-08-29 12:57:55 +02:00
benbrummer
61728ec89b Fix mariadb-client connection to mysql
Debian Trixie has a new mariadb-client, with encryption by default

Signed-off-by: benbrummer <info@benjamin-brummer.de>
2025-08-29 12:51:27 +02:00
benbrummer
1bda3e5809 Use health endpoint for HEALTHCHECK
Signed-off-by: benbrummer <info@benjamin-brummer.de>
2025-08-29 08:02:56 +02:00
David Bomba
6a16f6f4de Merge pull request #770 from TheNewSound/debian
Use default supervisord config as baseline
2025-08-12 08:34:16 +10:00
v
68cfe612ee Start supervisord using /etc/supervisor/supervisord.conf so that a socket at /var/run is created (default supervisord config). 2025-08-01 15:45:54 +02:00
David Bomba
ed9c23d9c7 Merge pull request #753 from benbrummer/debian
saxon defaults now to 12.5.0
2025-05-11 09:44:26 +10:00
benbrummer
f6fa32f606 saxon defaults now to 12.5.0
Signed-off-by: benbrummer <info@benjamin-brummer.de>
2025-05-10 10:59:13 +02:00
David Bomba
a0454d3998 Merge pull request #745 from benbrummer/debian
remove bootstrap/cache volume
2025-04-05 06:49:13 +11:00
benbrummer
04f4dbe248 remove bootstrap/cache volume
align with docker hub tutorial about laravel
* https://docs.docker.com/guides/frameworks/laravel/
* https://github.com/dockersamples/laravel-docker-examples/blob/main/compose.prod.yaml#L14

Signed-off-by: benbrummer <info@benjamin-brummer.de>
2025-04-04 11:43:33 +02:00
benbrummer
a7822987b2 Merge pull request #744 from gianluigitrontini/debian
Fixes #743: Move conditionals for chromium/google chrome before artisan optimize
2025-04-03 16:47:12 +02:00
Gianluigi Trontini
7b7f3df710 Fixes #743: Move conditionals for chromium/google chrome at the top of the file 2025-04-03 15:37:52 +02:00
benbrummer
a9b3a8a8a4 Merge pull request #737 from RichyHBM/patch-1
Create required dirs if missing
2025-03-29 09:55:16 +01:00
Richy HBM
a53b702c45 Create required dirs if missing
Signed-off-by: Richy HBM <RichyHBM@users.noreply.github.com>
2025-03-27 16:04:35 +00:00
David Bomba
39c546e270 remove default prop for snappdf pay 2025-03-25 12:03:04 +11:00
David Bomba
9c0e00edb3 Add conditionals for chromium/google chrome 2025-03-25 12:02:47 +11:00
David Bomba
1f28106e43 Merge pull request #731 from benbrummer/debian
use github latest url, tar.gz without top level repository
2025-03-19 10:05:15 +11:00
David Bomba
c4513a868a Merge pull request #733 from fabiomanz/patch-1
Upgrade from old docker-compose syntax to v2 docker compose syntax
2025-03-18 02:54:22 +11:00
Fabio
856d47217e Upgrade from old docker-compose syntax to v2 docker compose syntax
Signed-off-by: Fabio <fabio.manz@t-online.de>
2025-03-17 13:57:36 +01:00
Benjamin Brummer
be0ec204d4 use github latest url, tar.gz without top level repository 2025-03-15 06:35:12 +00:00
David Bomba
9d99120693 Merge pull request #713 from turbo124/debian
Fixes for publish image regression - force 22.04
2025-01-24 16:12:59 +11:00
David Bomba
a5204ccb7d Fixes for publish image regression - force 22.04 2025-01-24 16:12:25 +11:00
David Bomba
995d70ab60 Merge pull request #706 from turbo124/debian
Fixes for php extension installer
2025-01-24 12:59:21 +11:00
David Bomba
11855e0701 Fixes for php extension installer 2025-01-24 12:58:04 +11:00
David Bomba
42816b6282 Require mbstring 2025-01-24 09:23:10 +11:00
David Bomba
2ad607fa2d Create auto-close-issues.yml
Signed-off-by: David Bomba <turbo124@gmail.com>
2025-01-21 13:47:56 +11:00
David Bomba
2c25caf627 Merge pull request #694 from benbrummer/debian
Fix for reap logging
2025-01-15 08:56:09 +11:00
benbrummer
a2b64d2060 Merge branch 'invoiceninja:debian' into debian 2025-01-14 22:32:43 +01:00
Benjamin Brummer
b58d4e1259 fix for reaps 2025-01-14 21:31:50 +00:00
Benjamin Brummer
a7683ada33 log to stdout 2025-01-14 21:19:38 +00:00
Benjamin Brummer
3e8a6c72a7 healthcheck for php-fpm master process 2025-01-14 21:19:25 +00:00
David Bomba
3b0f7c463a Merge pull request #691 from benbrummer/debian
php optimization
2025-01-15 08:18:25 +11:00
Benjamin Brummer
c00d44380c log worker to stdout/stderr 2025-01-13 16:34:49 +00:00
Benjamin Brummer
cb4120fc54 Multistage, single init.sh 2025-01-13 16:31:39 +00:00
Benjamin Brummer
f2c5a1f842 composer is not needed, permissions are already correct in the image 2025-01-13 13:11:50 +00:00
Benjamin Brummer
029bc57fac download invoiceninja.tar.gz 2025-01-13 13:09:33 +00:00
Benjamin Brummer
d60bf39950 set correct file-extension 2025-01-13 12:52:28 +00:00
Benjamin Brummer
31eb278f0d prefer files from image 2025-01-13 12:30:06 +00:00
Benjamin Brummer
44b460bf13 php optimization opcache and realpath 2025-01-13 12:22:01 +00:00
Benjamin Brummer
7bae300fd2 disable preload for artisan tinker 2025-01-13 12:20:03 +00:00
David Bomba
3394694ffc Merge pull request #676 from benbrummer/debian
arm64 image with chromium
2024-12-24 18:28:05 +11:00
Benjamin Brummer
99f280319c saxon is available for arm64 and amd64 2024-12-21 20:38:44 +01:00
Benjamin Brummer
470a3d036d EXPOSE is already inherited from base image 2024-12-21 20:37:47 +01:00
Benjamin Brummer
514ebb74c6 No need to have arm64 and amd64 for php extensions 2024-12-21 20:37:16 +01:00
Benjamin Brummer
dc3b87140f Install chromium for arm64 2024-12-21 20:36:20 +01:00
Benjamin Brummer
c0afd971e1 mariadb is the default on debian 2024-12-21 20:32:22 +01:00
Benjamin Brummer
677cc44a15 remove gosu 2024-12-21 20:31:42 +01:00
David Bomba
91c7b1ea2a Merge pull request #673 from turbo124/debian
Updates for github actions
2024-12-11 09:55:32 +11:00
David Bomba
a508ccc41e Updates for github actions 2024-12-11 09:53:54 +11:00
David Bomba
d42f66617c Merge pull request #672 from brdns/debian
Remove nginx `[warn]` log when uploading
2024-12-10 06:10:58 +11:00
brdns
8746015041 Removes nginx logs when uploading: [warn] a client request body is buffered to a temporary file
[warn] a client request body is buffered to a temporary file
Was already fixed with commit bfc61fb64e
Then got reverted by commit 66408fccb2
2024-12-09 18:02:44 +01:00
David Bomba
53c38b65f9 Merge pull request #664 from benbrummer/debian-dev
dockerfile cleanup, apt reduction, php module configuration, allow to run custom CMD
2024-12-06 08:49:18 +11:00
Benjamin Brummer
473e38259f Merge remote-tracking branch 'origin/debian' into debian-dev
CMD was not properly handled
2024-12-05 13:57:10 +01:00
Benjamin Brummer
d538666600 final fix for if statement 2024-12-05 13:47:42 +01:00
Benjamin Brummer
0ace427585 - supervisord.conf defines nodaemon already
- Fix if statement
2024-12-05 13:35:32 +01:00
benbrummer
8c1357fc4c Merge branch 'debian' into debian-dev
Signed-off-by: benbrummer <info@benjamin-brummer.de>
2024-12-05 10:52:43 +01:00
Benjamin Brummer
806a340a00 - make it possible to run a custom CMD
- rename volume according to their origin
- Add arguments for required, suggested and extra php-modules
2024-12-05 10:34:45 +01:00
Benjamin Brummer
d437dab72c remove upload folder 2024-12-04 10:24:10 +01:00
Benjamin Brummer
d64ed83abf temporarly install gpg 2024-12-03 23:57:20 +01:00
Benjamin Brummer
337f38e0dc remove default values 2024-12-03 10:53:13 +01:00
David Bomba
5d5c036175 Merge pull request #667 from turbo124/debian
Patches for copying files
2024-12-03 15:01:54 +11:00
David Bomba
d5ed1935f7 set port 80 2024-12-03 15:01:08 +11:00
David Bomba
5e40e34943 run local init.sh file 2024-12-03 14:59:41 +11:00
David Bomba
c4e1d0e3a5 Updates for copy files 2024-12-03 14:49:58 +11:00
David Bomba
84dcb8caab Merge pull request #665 from turbo124/debian
Update dockerfile
2024-12-03 12:40:39 +11:00
Benjamin Brummer
733e72d5dd curl is already installed 2024-12-02 12:56:24 +01:00
Benjamin Brummer
7eaf6968d2 - fonts-noto-cjk-extra depends on fonts-noto-cjk
- *-dev packages are not required
- fonts depends on libpng16-16 (no dev)
2024-12-02 12:30:17 +01:00
Benjamin Brummer
66408fccb2 align php settings with recommendations opcache/jit from php.net (aligned for php 8.3 and 8.4), increased buffernumber to allow parallel requests without writing to file 2024-12-02 11:53:27 +01:00
Benjamin Brummer
79647d4f8c Fix do not delete public folder on container restart 2024-12-02 11:29:40 +01:00
Benjamin Brummer
067b5eb194 remove value, which matches default 2024-12-01 14:53:48 +01:00
Benjamin Brummer
eed358c32b extended gzip configuration 2024-12-01 14:38:48 +01:00
Benjamin Brummer
71909c73e0 configure chrome during installation 2024-12-01 13:46:58 +01:00
Benjamin Brummer
fab57c9db3 Ensure permissions on volumes are correct
mv public directory inside a single RUN to not increase the image
2024-12-01 12:11:57 +01:00
Benjamin Brummer
e7bc565745 Set correct owner, file and directory permissions. 2024-12-01 10:39:40 +01:00
Benjamin Brummer
87092bb8bd All directories apart of "uploads" exist already 2024-12-01 10:27:06 +01:00
Benjamin Brummer
5abd297c7f switch to user www-data before running tar. tar -o will set correct ownership afterwards. 2024-12-01 09:48:12 +01:00
Benjamin Brummer
8be252781f google-chrome only needs to have ownership for /var/www, which is by default owned by root 2024-12-01 09:42:29 +01:00
David Bomba
f281b33ea1 Update dockerfile 2024-11-30 22:05:28 +11:00
Benjamin Brummer
22d170a4e5 shrink directory configuration 2024-11-29 13:40:46 +01:00
Benjamin Brummer
f722c91d21 Merge chrome related configuration into one RUN 2024-11-29 11:04:11 +01:00
Benjamin Brummer
641b527702 fix if else 2024-11-29 10:48:14 +01:00
Benjamin Brummer
d139a48303 move google-chrome-stable related apt packages to arm64 2024-11-29 10:26:46 +01:00
benbrummer
a75b6f0a00 Merge branch 'invoiceninja:debian' into debian 2024-11-29 09:45:20 +01:00
David Bomba
113c700754 Merge pull request #663 from turbo124/debian
Corrective fixes for new dockerfile
2024-11-29 13:57:39 +11:00
David Bomba
b6be06c977 Corrective fixes for new dockerfile 2024-11-29 13:56:46 +11:00
benbrummer
8c53895c97 Merge branch 'invoiceninja:debian' into debian 2024-11-28 21:52:35 +01:00
Benjamin Brummer
8204465048 cleanup 2024-11-28 21:35:05 +01:00
David Bomba
baad65c737 Merge pull request #661 from benbrummer/debian
php 8.3 and apt package optimization
2024-11-29 07:17:52 +11:00
benbrummer
9fd35b874d second try for nginx
Signed-off-by: benbrummer <info@benjamin-brummer.de>
2024-11-28 16:18:05 +01:00
benbrummer
fe4993f8a3 set correct mount destination for nginx
Signed-off-by: benbrummer <info@benjamin-brummer.de>
2024-11-28 15:50:38 +01:00
Benjamin Brummer
b83fb831b9 - Use default laravel nginx and extend it with invoiceninja -specific settings
- Overwrite php.ini/php-fpm.ini settings with customized settings
2024-11-28 14:04:11 +01:00
Benjamin Brummer
687e74c983 Fix: app-1 for supervisor warning redirect_stderr 2024-11-28 10:55:29 +01:00
Benjamin Brummer
7644151370 memory limits are not aligned with php/opcache and cause error 500 2024-11-28 10:26:23 +01:00
Benjamin Brummer
c84f80f9a9 add build context to docker-compose.yml 2024-11-28 10:23:25 +01:00
Benjamin Brummer
6cfdca078f - Update to php 8.3
- Minimal system packages
  - additional packages will be handled as dependencies of google-chrome-stable (amd64
  - arm64 will still install all apt packages
- "--no-install-recommends" for apt-get
2024-11-28 10:22:05 +01:00
David Bomba
74ed1b2432 Merge pull request #659 from benbrummer/debian
install saxon 12.5.0 with install-php-extensions
2024-11-28 11:28:26 +11:00
Benjamin Brummer
b3b7f7b9f0 - install saxon with install-php-extensions
- replace deprecated apt-key
- artisan optimize will handle caches
2024-11-27 13:01:46 +01:00
David Bomba
a6d8f663ae Merge pull request #656 from benbrummer/debian
Use php.ini-production
2024-11-27 19:27:34 +11:00
David Bomba
3024f11a31 Merge pull request #658 from brdns/debian-dev
move client_max_body_size from default.conf to nginx.conf
2024-11-27 19:19:14 +11:00
Benjamin Brummer
6274c432d9 Fix access for nginx to storage/public 2024-11-26 17:16:09 +01:00
Brandon
f5afd3f527 Revert "Prevents swapping on pdf generation with Chrome"
This reverts commit 3ce5983131.
2024-11-26 16:28:04 +01:00
Brandon
3ce5983131 Prevents swapping on pdf generation with Chrome
Increase allowed memory usage of main container from 512M to 1G

This is useful particularly if the server uses a hard drive, which can drastically slow down pdf generation during swap
2024-11-26 16:22:38 +01:00
Brandon
bfc61fb64e client_max_body_size is a parameter of nginx.conf and not of default.conf (https://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size )
add client_body_buffer_size

prevents the following logs: [warn] a client request body is buffered to a temporary file
2024-11-26 16:07:27 +01:00
Benjamin Brummer
535d6d4c06 Refactoring docker-compose.yml 2024-11-26 12:50:59 +01:00
Benjamin Brummer
24d49a4374 refactoring dockerfile 2024-11-26 12:49:12 +01:00
Benjamin Brummer
30ad63f306 Use php.ini-production 2024-11-26 09:46:36 +01:00
David Bomba
60fd0aa79e Merge pull request #655 from turbo124/debian
Set home path for PHP when supervisor boots
2024-11-26 08:31:54 +11:00
David Bomba
d1786100ca Set home path for PHP when supervisor boots 2024-11-26 08:31:18 +11:00
David Bomba
f58ca724c9 Merge pull request #653 from turbo124/debian
Expose storage/ for nginx
2024-11-25 21:38:53 +11:00
David Bomba
53cadbf750 Expose storage/ for nginx 2024-11-25 21:38:26 +11:00
David Bomba
3fca330958 Merge pull request #651 from turbo124/debian
Updates for volume mounts
2024-11-25 11:39:13 +11:00
David Bomba
7d79b39bc2 Updates for volume mounts 2024-11-25 11:38:39 +11:00
David Bomba
aa271a1488 Merge pull request #650 from turbo124/debian
Add index.html to public/
2024-11-25 09:14:58 +11:00
David Bomba
451c1b872f Add index.html to public/ 2024-11-25 09:14:34 +11:00
David Bomba
5c74753da2 Merge pull request #648 from turbo124/debian
Updates for resolving filessystem
2024-11-24 19:58:47 +11:00
David Bomba
83f17aa669 Updates for resolving filessystem 2024-11-24 19:56:02 +11:00
David Bomba
394c4c8b5e Merge pull request #647 from turbo124/debian
Add storage link
2024-11-24 16:17:53 +11:00
David Bomba
9ed63a6762 add storage link 2024-11-24 15:48:15 +11:00
David Bomba
cb6d6d46c2 Merge pull request #646 from turbo124/debian
Adjustments for permissions
2024-11-24 11:51:49 +11:00
David Bomba
3b0e475de6 Adjustments for permissions 2024-11-24 11:50:13 +11:00
David Bomba
d5bb90fa04 Merge pull request #644 from turbo124/debian
Fixes for permissions on container init
2024-11-24 08:44:10 +11:00
David Bomba
1b62d86659 Fixes for permissions on container init 2024-11-24 08:43:50 +11:00
David Bomba
4431abcb88 Merge pull request #643 from turbo124/debian
Updates for permission handling in the container
2024-11-23 21:00:01 +11:00
David Bomba
d05e55a24e Updates for permission handling in the container 2024-11-23 20:58:56 +11:00
David Bomba
34e5043317 Merge pull request #642 from turbo124/debian
Fixes for tar command flags
2024-11-23 19:14:23 +11:00
David Bomba
6f92d1c155 Fixes for tar command flags 2024-11-23 19:13:59 +11:00
David Bomba
11330003a2 Merge pull request #641 from turbo124/debian
Updates for tar extraction
2024-11-23 19:01:32 +11:00
David Bomba
47b015af7c More explicity unpacking of .tar file 2024-11-23 19:00:45 +11:00
David Bomba
c6648a8511 Updates for tar extraction 2024-11-23 18:48:09 +11:00
David Bomba
de2036adff Merge pull request #640 from turbo124/debian
Fixes for tar command flags
2024-11-23 17:07:22 +11:00
David Bomba
ea8c5fed8e Fixes for tar command flags 2024-11-23 17:07:00 +11:00
David Bomba
c2f8cedc4a Merge pull request #639 from turbo124/debian
Enforce latest tags during build
2024-11-23 17:02:05 +11:00
David Bomba
7ddfe8a793 Enforce latest tags 2024-11-23 17:01:28 +11:00
David Bomba
196e66e06d updates for container 2024-11-23 16:57:44 +11:00
David Bomba
7498a94bd1 Merge pull request #638 from turbo124/debian
Update readme
2024-11-23 16:33:49 +11:00
David Bomba
8289c6c65e Update readme 2024-11-23 16:23:14 +11:00
David Bomba
b75ac4fd87 Update directory 2024-11-23 16:09:11 +11:00
David Bomba
94d3f6212e Merge pull request #636 from turbo124/debian
Update github action versions
2024-11-23 16:07:46 +11:00
David Bomba
a940bf2ed2 Update github action versions 2024-11-23 16:07:18 +11:00
David Bomba
76ca42bddb Merge pull request #635 from turbo124/debian
Finalize documentation
2024-11-23 14:26:12 +11:00
David Bomba
84194970b3 Merge branch 'debian' into debian
Signed-off-by: David Bomba <turbo124@gmail.com>
2024-11-23 14:26:06 +11:00
David Bomba
919e15fb40 Readme formatting 2024-11-23 14:24:50 +11:00
David Bomba
2b8bb21d04 Readme formatting 2024-11-23 14:24:14 +11:00
David Bomba
8ff82909c8 Updates for defaults 2024-11-23 14:20:08 +11:00
David Bomba
7ce743bd91 Shield Badges 2024-11-23 14:19:33 +11:00
David Bomba
ffc777d5f1 Shield Badges 2024-11-23 14:17:26 +11:00
David Bomba
1446bfabfc Shield Badges 2024-11-23 14:14:25 +11:00
David Bomba
5ae3240677 Update README.md
Signed-off-by: David Bomba <turbo124@gmail.com>
2024-11-23 14:12:02 +11:00
David Bomba
1fc60549c2 Update README.md
Signed-off-by: David Bomba <turbo124@gmail.com>
2024-11-23 14:10:04 +11:00
David Bomba
a5ad84f22b Merge pull request #634 from turbo124/debian
conditionally build saxon on amd64 only.
2024-11-23 09:44:06 +11:00
David Bomba
e5847a6ff1 Conditionally build saxon on amd64 2024-11-23 09:43:28 +11:00
David Bomba
1c1bc350dc Rename gh action 2024-11-23 08:58:24 +11:00
David Bomba
e83372d437 Merge pull request #633 from turbo124/debian
fixes for amd64 builds
2024-11-23 08:52:09 +11:00
David Bomba
22b2f5416a fixes for amd64 builds 2024-11-23 08:51:42 +11:00
David Bomba
dbb671eeab Merge pull request #632 from turbo124/debian
Fixes for build stages on different architectures.
2024-11-23 08:44:00 +11:00
David Bomba
baf7b2bff7 Conditional builds for google chrome 2024-11-23 08:43:25 +11:00
David Bomba
db7c7de624 Fixes for trailing backslashes 2024-11-23 08:41:54 +11:00
21 changed files with 504 additions and 540 deletions

19
.github/workflows/auto-close-issues.yml vendored Normal file
View File

@@ -0,0 +1,19 @@
name: Close stale issues after 5 days
on:
schedule:
- cron: "0 0 * * *"
jobs:
close-issues:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/stale@v10
with:
days-before-issue-stale: 4
days-before-issue-close: 1
stale-issue-label: "stale"
close-issue-message: "This issue has been automatically closed due to inactivity for 5 days."
repo-token: ${{ secrets.GITHUB_TOKEN }}
exempt-issue-labels: "keep-open,triage,bug"

View File

@@ -3,36 +3,47 @@ name: Build Debian Container Image
on:
pull_request:
paths:
- ".github/**"
- "debian/**"
push:
paths:
- ".github/**"
- "debian/**"
branches:
- master
env:
REGISTRY_IMAGE: invoiceninja/invoiceninja-debian
jobs:
docker:
runs-on: ubuntu-latest
build:
runs-on: ${{ startsWith(matrix.platform, 'linux/arm') && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm64
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
platforms: all
images: ${{ env.REGISTRY_IMAGE }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Build
id: docker_build
uses: docker/build-push-action@v5
id: build
uses: docker/build-push-action@v6
with:
context: debian
file: debian/Dockerfile
load: true
tags: invoiceninja/invoiceninja-debian:test
context: debian
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ env.REGISTRY_IMAGE }}
outputs: type=image,push-by-digest=true,name-canonical=true
cache-from: type=gha
cache-to: type=gha,mode=max

View File

@@ -0,0 +1,166 @@
name: Publish Debian Container Images
on:
push:
tags-ignore:
- "invoiceninja-*"
env:
REGISTRY_IMAGE: invoiceninja/invoiceninja-debian
jobs:
version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
major: ${{ steps.version.outputs.major }}
minor: ${{ steps.version.outputs.minor }}
url: ${{ steps.version.outputs.url }}
steps:
- id: version
run: |
VERSION=edge
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
# Remove -o or -d suffix if present
VERSION=${VERSION%-*}
fi
MAJOR="$(echo "${VERSION}" | cut -d. -f1)"
MINOR="$(echo "${VERSION}" | cut -d. -f2)"
URL=https://github.com/invoiceninja/invoiceninja/releases/download/v${VERSION}/invoiceninja.tar.gz
# Debug output
echo "Current version: ${VERSION}"
echo "Version pattern check: $([[ $VERSION =~ ^5\.[0-9]{1,3}\.[0-9]{1,3}$ ]] && echo "matches" || echo "doesn't match")"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "major=${MAJOR}" >> $GITHUB_OUTPUT
echo "minor=${MINOR}" >> $GITHUB_OUTPUT
echo "url=${URL}" >> $GITHUB_OUTPUT
build:
runs-on: ${{ startsWith(matrix.platform, 'linux/arm') && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
needs:
- version
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm64
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Prepare
id: prep
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Build and push by digest
id: build
uses: docker/build-push-action@v6
with:
context: debian
build-args: URL=${{ needs.version.outputs.url }}
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ env.REGISTRY_IMAGE }}
outputs: type=image,push-by-digest=true,name-canonical=true,push=${{ github.event_name != 'pull_request' }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Export digest
run: |
mkdir -p ${{ runner.temp }}/digests
digest="${{ steps.build.outputs.digest }}"
touch "${{ runner.temp }}/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: digests-${{ env.PLATFORM_PAIR }}
path: ${{ runner.temp }}/digests/*
if-no-files-found: error
retention-days: 1
merge:
runs-on: ubuntu-latest
needs:
- version
- build
steps:
- name: Download digests
uses: actions/download-artifact@v4
with:
path: ${{ runner.temp }}/digests
pattern: digests-*
merge-multiple: true
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}
tags: |
${{ needs.version.outputs.version }}
${{ needs.version.outputs.major }}
${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}
latest
- name: Create manifest list and push
working-directory: ${{ runner.temp }}/digests
if: ${{ github.event_name != 'pull_request' }}
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
- name: Inspect image
if: ${{ github.event_name != 'pull_request' }}
run: |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
Description:
if: ${{ github.event_name != 'pull_request' }}
runs-on: ubuntu-latest
needs:
- merge
steps:
- name: Checkout
uses: actions/checkout@v5
with:
sparse-checkout: "README.md"
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
repository: ${{ env.REGISTRY_IMAGE }}

View File

@@ -1,83 +0,0 @@
name: Publish Debian and Alpine Container Images
on:
push:
tags-ignore:
- "invoiceninja-*"
jobs:
docker:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- image: invoiceninja/invoiceninja-debian
context: ./debian
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Prepare
id: prep
run: |
DOCKER_IMAGE=${{ matrix.image }}
VERSION=edge
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
fi
TAGS="${DOCKER_IMAGE}:${VERSION}"
MAJOR="$(echo "${VERSION}" | cut -d. -f1)"
MINOR="$(echo "${VERSION}" | cut -d. -f2)"
TAGS="$TAGS,${DOCKER_IMAGE}:${MAJOR},${DOCKER_IMAGE}:${MAJOR}.${MINOR}"
if [[ $VERSION =~ ^5\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
TAGS="$TAGS,${DOCKER_IMAGE}:latest"
fi
echo ::set-output name=tags::${TAGS}
echo ::set-output name=version::${VERSION}
echo ::set-output name=major::${MAJOR}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-${{ matrix.image }}-buildx-${{ steps.prep.outputs.major }}-${{ hashFiles('**/cache_buster') }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ matrix.image }}-buildx-${{ steps.prep.outputs.major }}-${{ hashFiles('**/cache_buster') }}-
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: ${{ matrix.context }}
build-args: INVOICENINJA_VERSION=${{ steps.prep.outputs.version }}
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.prep.outputs.tags }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

View File

@@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

View File

@@ -12,7 +12,7 @@ jobs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
@@ -55,7 +55,7 @@ jobs:
- "1.23.15"
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

View File

@@ -1,15 +1,17 @@
[![Docker image, latest](https://img.shields.io/docker/image-size/invoiceninja/invoiceninja-debian/latest?label=latest)](https://hub.docker.com/r/invoiceninja/invoiceninja-debian)
[![Docker image, debian](https://img.shields.io/docker/image-size/invoiceninja/invoiceninja-debian/debian?label=debian)](https://hub.docker.com/r/invoiceninja/invoiceninja-debian)
[![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/invoiceninja)](https://artifacthub.io/packages/search?repo=invoiceninja)
[![Publish Image](https://github.com/invoiceninja/dockerfiles/actions/workflows/publish-image.yaml/badge.svg)](https://github.com/invoiceninja/dockerfiles/actions/workflows/publish-image.yaml)
[![Build Debian Image](https://github.com/invoiceninja/dockerfiles/actions/workflows/build-image-debian.yaml/badge.svg)](https://github.com/invoiceninja/dockerfiles/actions/workflows/build-image-debian.yaml)
[![Docker Image Size](https://img.shields.io/docker/image-size/invoiceninja/invoiceninja-debian?label=debian)](https://hub.docker.com/r/invoiceninja/invoiceninja-debian)
[![Docker Pulls](https://img.shields.io/docker/pulls/invoiceninja/invoiceninja-debian)](https://hub.docker.com/r/invoiceninja/invoiceninja-debian)
[![Publish Status](https://github.com/invoiceninja/dockerfiles/actions/workflows/publish-image-debian.yaml/badge.svg)](https://github.com/invoiceninja/dockerfiles/actions/workflows/publish-image-debian.yaml)
[![Build Status](https://github.com/invoiceninja/dockerfiles/actions/workflows/build-image-debian.yaml/badge.svg)](https://github.com/invoiceninja/dockerfiles/actions/workflows/build-image-debian.yaml)
# Debian Docker for [Invoice Ninja](https://www.invoiceninja.com/)
:crown: **Features**
👑 **Features**
:fire: NGINX webserver support [NGINX](https://nginx.org/)
:chrome: Built-in Chrome for PDF generation and other features
NGINX webserver support [NGINX](https://nginx.org/)
Built-in Chrome for PDF generation and other features
Saxon XLST 2 engine
OPcache
Multi language support
## Get started with Docker Compose
@@ -17,7 +19,7 @@ This Debian-based image includes Chrome for enhanced PDF generation and other fe
```bash
git clone https://github.com/invoiceninja/dockerfiles.git -b debian
cd dockerfiles
cd dockerfiles/debian
```
Instead of defining our environment variables inside our docker-compose.yml file we now define this in the `.env` file, open this file up and insert your `APP_URL`, `APP_KEY` and update the rest of the variables as required.
@@ -31,26 +33,38 @@ IN_USER_EMAIL=
IN_PASSWORD=
```
If `IN_USER_EMAIL` and `IN_PASSWORD` is not set the default user email and password is "admin@example.com" and "changeme!" respectively. You will use this for the initial login, thereafter, you can delete these two environment variables.
## Initial account setup
The `APP_KEY` can be generated by running
### Primary account setup
Prior to starting the container for the first time, open the .env file and update the IN_USER_EMAIL and IN_PASSWORD variables with your primary account.
This will take care of the initial account setup. You can later remove these .env variables.
> ⚠️ **Warning**
> If `IN_USER_EMAIL` and `IN_PASSWORD` are not set the default user email and password is "admin@example.com" and "changeme!" respectively.
After the container has completed the first startup you can delete these two environment variables.
### Generate a APP_KEY
The `APP_KEY` can be generated by running:
```bash
# If you haven't started the containers yet:
docker run --rm -it invoiceninja/invoiceninja-debian php artisan key:generate --show
# Or if your containers are already running:
docker-compose exec app php artisan key:generate --show
docker compose exec app php artisan key:generate --show
```
Copy the entire string and insert in the env file at `APP_KEY=base64....`
Copy the entire string and insert in the .env file at `APP_KEY=base64....`
**Note: For PDF generation using localhost, your domain name MUST end in .test for PDFs to generate correctly due to Chrome's DNS resolver.
Start the container with:
```bash
docker-compose up -d
docker compose up -d
```
**Note: When performing the setup, the Database host is ```mysql```
@@ -60,13 +74,21 @@ docker-compose up -d
To upgrade to a newer release image, update your docker-compose.yml first by running:
```bash
docker-compose down
docker-compose pull
docker-compose up
docker compose pull
docker compose up -d
```
It is recommended to perform a backup before updating.
### Support
If you discover a bug, please create an issue. For general queries, visit our [Forum](https://forum.invoiceninja.com/)
If you discover a bug, please create an issue. For general queries, visit our [Forum](https://forum.invoiceninja.com/)
### Todo
This is a new image which should provide much better support for all users, however there are some items left to complete
- [ ] Backup script
- [ ] Integrate soketi server
- [ ] Add elastic search for site wide search

16
debian/.env vendored
View File

@@ -8,7 +8,16 @@ PHANTOMJS_PDF_GENERATION=false
PDF_GENERATOR=snappdf
TRUSTED_PROXIES='*'
QUEUE_CONNECTION=database
CACHE_DRIVER=redis
QUEUE_CONNECTION=redis
SESSION_DRIVER=redis
REDIS_HOST=redis
REDIS_PASSWORD=null
REDIS_PORT=6379
FILESYSTEM_DISK=debian_docker
# DB connection
DB_HOST=mysql
@@ -48,5 +57,6 @@ NORDIGEN_SECRET_KEY=
IS_DOCKER=true
SCOUT_DRIVER=null
SNAPPDF_CHROMIUM_PATH=/usr/bin/google-chrome-stable
#SNAPPDF_CHROMIUM_PATH=/usr/bin/google-chrome
#SNAPPDF_CHROMIUM_PATH=/usr/bin/google-chrome-stable

217
debian/Dockerfile vendored
View File

@@ -1,173 +1,90 @@
FROM php:8.2-fpm AS base
ARG saxon=12.5.0
ARG PHP=8.4
FROM php:${PHP}-fpm AS prepare-app
ARG URL=https://github.com/invoiceninja/invoiceninja/releases/latest/download/invoiceninja.tar.gz
ADD ${URL} /tmp/invoiceninja.tar.gz
RUN tar -xzf /tmp/invoiceninja.tar.gz -C /var/www/html \
&& ln -s /var/www/html/resources/views/react/index.blade.php /var/www/html/public/index.html \
&& php artisan storage:link \
# Workaround for application updates
&& mv /var/www/html/public /tmp/public
# ==================
# InvoiceNinja image
# ==================
FROM php:${PHP}-fpm
# PHP modules
ARG php_require="bcmath gd mbstring pdo_mysql zip"
ARG php_suggest="exif imagick intl pcntl saxon soap"
ARG php_extra="opcache"
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
zip \
unzip \
gosu \
default-mysql-client \
RUN apt-get update && apt-get install -y --no-install-recommends \
libfcgi-bin \
mariadb-client \
gpg \
supervisor \
fonts-liberation \
libasound2 \
libatk-bridge2.0-0 \
libatk1.0-0 \
libatspi2.0-0 \
libcups2 \
libdbus-1-3 \
libdrm2 \
libgbm1 \
libgtk-3-0 \
libnspr4 \
libnss3 \
libwayland-client0 \
libxcomposite1 \
libxdamage1 \
libxfixes3 \
libxkbcommon0 \
libxrandr2 \
xdg-utils \
fonts-noto-cjk \
fonts-noto-cjk-extra \
fonts-wqy-microhei \
fonts-wqy-zenhei \
xfonts-wqy \
wget \
gnupg2 \
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list \
# Unicode support for PDF
fonts-noto-cjk-extra \
fonts-wqy-microhei \
fonts-wqy-zenhei \
xfonts-wqy \
# Install google-chrome-stable(amd64)/chromium(arm64)
&& if [ "$(dpkg --print-architecture)" = "amd64" ]; then \
mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://dl.google.com/linux/linux_signing_key.pub | \
gpg --dearmor -o /etc/apt/keyrings/google.gpg \
&& echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/google.gpg] https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list \
&& apt-get update \
&& apt-get install -y google-chrome-stable \
&& apt-get install -y --no-install-recommends google-chrome-stable; \
elif [ "$(dpkg --print-architecture)" = "arm64" ]; then \
apt-get install -y --no-install-recommends \
chromium; \
fi \
# Create config directory for chromium/google-chrome-stable
&& mkdir /var/www/.config \
&& chown www-data:www-data /var/www/.config \
# Cleanup
&& apt-get purge -y gpg \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Set permissions for www-data to execute
RUN mkdir -p /var/www/.chrome/chrome-profile \
&& chown -R www-data:www-data /var/www/.chrome \
&& chmod -R 755 /var/www/.chrome \
&& chown root:root /usr/bin/google-chrome \
&& chmod 4755 /usr/bin/google-chrome \
&& chown -R root:root /opt/google/chrome \
&& chmod -R 755 /opt/google/chrome \
&& chown -R www-data:www-data /var/www
# Install PHP extensions
COPY --from=ghcr.io/mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
# Create required directories with proper permissions
RUN mkdir -p /tmp/chrome \
&& chown -R www-data:www-data /tmp/chrome \
&& chmod -R 755 /tmp/chrome
# Copy Install PHP extensions installer
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
# Install Required PHP extensions.
RUN install-php-extensions \
pdo_mysql \
mysqli \
mbstring \
exif \
pcntl \
bcmath \
gd \
opcache \
redis \
soap \
imagick \
curl \
gmp \
zip \
@composer
${php_require} \
${php_suggest} \
${php_extra}
# Configure PHP
COPY php/php.ini /usr/local/etc/php/conf.d/app.ini
COPY php/php-fpm.conf /usr/local/etc/php-fpm.d/www.conf
RUN ln -s "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
# Configure Saxon
WORKDIR /opt
COPY php/php.ini /usr/local/etc/php/conf.d/invoiceninja.ini
## fetch
RUN curl https://downloads.saxonica.com/SaxonC/HE/12/libsaxon-HEC-linux-x86_64-v${saxon}.zip --output saxon.zip
RUN unzip saxon.zip -d saxon
RUN cp saxon/libsaxon-HEC-linux-amd64-v${saxon}/libs/nix/libsaxon-hec-${saxon}.so /usr/lib/
WORKDIR /opt/saxon/libsaxon-HEC-linux-amd64-v${saxon}/Saxon.C.API
RUN phpize
RUN ./configure --enable-saxon
RUN make
RUN ls -al
RUN make install
RUN echo 'extension=saxon.so' > "/usr/local/etc/php/conf.d/app.ini"
COPY php/php-fpm.conf /usr/local/etc/php-fpm.d/invoiceninja.conf
# Copy scripts
COPY rootfs /
# Set working directory
WORKDIR /var/www/html
# Download and extract application
RUN set -eux; \
DOWNLOAD_URL=$(curl -s "https://api.github.com/repos/invoiceninja/invoiceninja/releases/latest" | \
grep -o '"browser_download_url": "[^"]*invoiceninja.tar"' | cut -d '"' -f 4) && \
curl -L "$DOWNLOAD_URL" | tar -xvz -C /var/www/html && \
rm -rf /var/www/html/ui && \
chown -R www-data:www-data /var/www/html
# Install dependencies
RUN composer install --no-dev --no-scripts --no-autoloader
# Generate optimized autoloader and clear cache
RUN composer dump-autoload --optimize \
&& php artisan optimize \
&& php artisan view:cache \
&& php artisan config:cache \
&& php artisan route:cache
# Workaround: Disable SSL for mariadb-client for compatibility with MySQL
RUN echo "skip-ssl = true" >> /etc/mysql/mariadb.conf.d/50-client.cnf
# Setup supervisor
COPY supervisor/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Setup InvoiceNinja
COPY --from=prepare-app --chown=www-data:www-data /var/www/html /var/www/html
COPY --from=prepare-app --chown=www-data:www-data /tmp/public /tmp/public
# Add initialization script
COPY scripts/init.sh /usr/local/bin/init.sh
# Make executable
RUN chmod +x /usr/local/bin/init.sh
# Configure PHP-FPM
RUN sed -i "s/user = www-data/user = www-data/g" /usr/local/etc/php-fpm.d/www.conf \
&& sed -i "s/group = www-data/group = www-data/g" /usr/local/etc/php-fpm.d/www.conf
# Create volume directories
RUN mkdir -p \
/var/www/html/storage/app/public \
/var/www/html/storage/framework/cache \
/var/www/html/storage/framework/sessions \
/var/www/html/storage/framework/views \
/var/www/html/storage/logs \
/var/www/html/public/uploads \
/var/run \
/var/log/supervisor
# Set permissions
RUN chown -R www-data:www-data \
/var/www/html/storage \
/var/www/html/bootstrap/cache \
/var/www/html/public/uploads \
/var/run \
/var/log/supervisor \
&& chmod -R 775 \
/var/www/html/public/uploads \
/var/www/html/storage \
/var/www/html/bootstrap/cache \
/var/run \
/var/log/supervisor
COPY --chmod=0755 scripts/init.sh /usr/local/bin/init.sh
# Health check
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
CMD php -v || exit 1
EXPOSE 9000
HEALTHCHECK --start-period=100s \
CMD REMOTE_ADDR=127.0.0.1 REQUEST_URI=/health REQUEST_METHOD=GET SCRIPT_FILENAME=/var/www/html/public/index.php cgi-fcgi -bind -connect 127.0.0.1:9000 | grep '{"status":"ok","message":"API is healthy"}'
ENTRYPOINT ["/usr/local/bin/init.sh"]
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
CMD ["supervisord", "-c", "/etc/supervisor/supervisord.conf"]

View File

@@ -1,64 +1,39 @@
version: '3.8'
x-logging: &default-logging
options:
max-size: "10m"
max-file: "3"
driver: json-file
services:
app:
# image: deb40d:latest
image: invoiceninja/invoiceninja-debian:latest
build:
context: .
image: invoiceninja/invoiceninja-debian:${TAG:-latest}
restart: unless-stopped
env_file:
- ./.env
volumes:
- ./.env:/var/www/html/.env
# - ./php/php.ini:/usr/local/etc/php/conf.d/invoiceninja.ini:ro
# - ./php/php-fpm.conf:/usr/local/etc/php-fpm.d/invoiceninja.conf:ro
# - ./supervisor/supervisord.conf:/etc/supervisor/conf.d/supervisord.conf:ro
- app_public:/var/www/html/public
- app_storage:/var/www/html/storage
- app_cache:/var/www/html/bootstrap/cache
- public_files:/var/www/html/public
networks:
- app-network
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
deploy:
resources:
limits:
memory: 512M
logging: *default-logging
nginx:
image: nginx:alpine
restart: unless-stopped
ports:
- "8013:80"
- "80:80"
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d:ro
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- type: volume
source: public_files
target: /var/www/html/public
read_only: true
networks:
- app-network
- ./nginx:/etc/nginx/conf.d:ro
- app_public:/var/www/html/public:ro
- app_storage:/var/www/html/storage:ro
depends_on:
- app
deploy:
resources:
limits:
memory: 128M
logging: *default-logging
app:
condition: service_healthy
mysql:
image: mysql:8.0
image: mysql:8
restart: unless-stopped
env_file:
- ./.env
environment:
MYSQL_DATABASE: ${DB_DATABASE}
MYSQL_USER: ${DB_USERNAME}
@@ -66,51 +41,32 @@ services:
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
volumes:
- mysql_data:/var/lib/mysql
networks:
- app-network
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u${MYSQL_USER}", "-p${MYSQL_PASSWORD}"]
interval: 10s
timeout: 5s
retries: 5
deploy:
resources:
limits:
memory: 1G
logging: *default-logging
test:
[
"CMD",
"mysqladmin",
"ping",
"-h",
"localhost",
"-u${MYSQL_USER}",
"-p${MYSQL_PASSWORD}",
]
redis:
image: redis:alpine
restart: unless-stopped
volumes:
- redis_data:/data
networks:
- app-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
deploy:
resources:
limits:
memory: 256M
logging: *default-logging
networks:
app-network:
driver: bridge
volumes:
app_storage:
driver: local
app_public:
driver: local
app_cache:
app_storage:
driver: local
mysql_data:
driver: local
redis_data:
driver: local
public_files:
driver: local

View File

@@ -1,38 +0,0 @@
server {
error_log /var/log/nginx/error.log debug;
access_log /var/log/nginx/access.log;
listen 80 default_server;
server_name _;
server_tokens off;
client_max_body_size 100M;
root /var/www/html/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 ~* /storage/.*\.php$ {
return 503;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass app: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;
}
}

14
debian/nginx/invoiceninja.conf vendored Normal file
View File

@@ -0,0 +1,14 @@
# https://nginx.org/en/docs/http/ngx_http_core_module.html
client_max_body_size 10M;
client_body_buffer_size 10M;
server_tokens off;
# https://nginx.org/en/docs/http/ngx_http_fastcgi_module.html
fastcgi_buffers 32 16K;
# https://nginx.org/en/docs/http/ngx_http_gzip_module.html
gzip on;
gzip_comp_level 2;
gzip_min_length 1M;
gzip_proxied any;
gzip_types *;

32
debian/nginx/laravel.conf vendored Normal file
View File

@@ -0,0 +1,32 @@
# https://laravel.com/docs/master/deployment#nginx
server {
listen 80 default_server;
server_name _;
root /var/www/html/public;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
index index.php;
charset utf-8;
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; }
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_pass app:9000;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
}

View File

@@ -1,26 +0,0 @@
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log;
sendfile on;
keepalive_timeout 65;
gzip on;
include /etc/nginx/conf.d/*.conf;
}

View File

@@ -1,9 +1 @@
[www]
user = www-data
group = www-data
listen = 0.0.0.0:9000
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
pm.max_children = 10

37
debian/php/php.ini vendored
View File

@@ -1,21 +1,24 @@
session.auto_start = Off
short_open_tag = Off
[core]
; https://www.php.net/manual/en/ini.core.php
post_max_size=10M
upload_max_filesize=10M
memory_limit=512M
error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_DEPRECATED
[opcache]
; https://www.php.net/manual/en/opcache.installation.php#opcache.installation.recommended
opcache.enable_cli=1
opcache.enable=1
[jit]
; https://wiki.php.net/rfc/jit_config_defaults
opcache.jit=tracing
opcache.jit_buffer_size=64M
[extra]
; http://symfony.com/doc/current/performance.html
opcache.memory_consumption=256
opcache.max_accelerated_files=20000
opcache.preload=/var/www/html/preload.php
opcache.preload_user=www-data
; ; The OPcache shared memory storage size.
opcache.max_accelerated_files=300000
opcache.validate_timestamps=1
opcache.revalidate_freq=30
opcache.jit_buffer_size=256M
opcache.jit=1205
opcache.memory_consumption=1024M
post_max_size = 60M
upload_max_filesize = 50M
memory_limit=512M
opcache.validate_timestamps=0
realpath_cache_size = 4096K
realpath_cache_ttl = 600

View File

@@ -1,14 +0,0 @@
#!/bin/sh
php artisan db:seed --force
# Build up array of arguments...
if [[ ! -z "${IN_USER_EMAIL}" ]]; then
email="--email ${IN_USER_EMAIL}"
fi
if [[ ! -z "${IN_PASSWORD}" ]]; then
password="--password ${IN_PASSWORD}"
fi
php artisan ninja:create-account $email $password

138
debian/scripts/init.sh vendored
View File

@@ -1,73 +1,71 @@
#!/bin/sh
set -e
in_log() {
local type="$1"; shift
printf '%s [%s] [Entrypoint]: %s\n' "$(date -u '+%Y-%m-%dT%H:%M:%SZ')" "$type" "$*"
}
docker_process_init_files() {
echo
local f
for f; do
case "$f" in
*.sh)
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
# https://github.com/docker-library/postgres/pull/452
if [ -x "$f" ]; then
in_log INFO "$0: running $f"
"$f"
else
in_log INFO "$0: sourcing $f"
. "$f"
fi
;;
*) in_log INFO "$0: ignoring $f" ;;
esac
echo
done
}
# Create directories if they don't exist
mkdir -p \
/var/www/html/storage/app/public \
/var/www/html/storage/framework/cache \
/var/www/html/storage/framework/sessions \
/var/www/html/storage/framework/views \
/var/www/html/storage/logs \
/var/www/html/public/uploads
# Set directory permissions without changing ownership
chmod -R 775 \
/var/www/html/storage \
/var/www/html/bootstrap/cache \
/var/www/html/public/uploads
# Clear and cache config in production
if [ "$APP_ENV" = "production" ]; then
php artisan config:cache
php artisan optimize
php artisan package:discover
php artisan migrate --force
echo "Checking initialization status..."
# If first IN run, it needs to be initialized
echo "Checking initialization status..."
IN_INIT=$(php artisan tinker --execute='echo Schema::hasTable("accounts") && !App\Models\Account::all()->first();')
echo "IN_INIT value: $IN_INIT"
if [ "$IN_INIT" = "1" ]; then
echo "Running initialization scripts..."
docker_process_init_files /docker-entrypoint-init.d/*
fi
echo "Production setup completed"
echo "IN_INIT value: $IN_INIT"
#!/bin/sh -eu
# Set PDF generation browser path based on architecture
if [ "$(dpkg --print-architecture)" = "amd64" ]; then
export SNAPPDF_CHROMIUM_PATH=/usr/bin/google-chrome-stable
elif [ "$(dpkg --print-architecture)" = "arm64" ]; then
export SNAPPDF_CHROMIUM_PATH=/usr/bin/chromium
fi
echo "Starting supervisord..."
# Start supervisord in the foreground
exec /usr/bin/supervisord -n -c /etc/supervisor/conf.d/supervisord.conf
if [ "$*" = 'supervisord -c /etc/supervisor/supervisord.conf' ]; then
# Check for required folders and create if needed
[ -d /var/www/html/public] || mkdir -p /var/www/html/public
[ -d /var/www/html/storage/app/public ] || mkdir -p /var/www/html/storage/app/public
[ -d /var/www/html/storage/framework/sessions ] || mkdir -p /var/www/html/storage/framework/sessions
[ -d /var/www/html/storage/framework/views ] || mkdir -p /var/www/html/storage/framework/views
[ -d /var/www/html/storage/framework/cache ] || mkdir -p /var/www/html/storage/framework/cache
# Workaround for application updates
if [ "$(ls -A /tmp/public)" ]; then
echo "Updating public folder..."
rm -rf /var/www/html/public/.htaccess \
/var/www/html/public/.well-known \
/var/www/html/public/*
cp -r /tmp/public/* \
/tmp/public/.htaccess \
/tmp/public/.well-known \
/var/www/html/public/ && \
rm -rf /tmp/public/*
fi
echo "Public Folder is up to date"
# Ensure owner, file and directory permissions are correct
chown -R www-data:www-data \
/var/www/html/public \
/var/www/html/storage
find /var/www/html/public \
/var/www/html/storage \
-type f -exec chmod 644 {} \;
find /var/www/html/public \
/var/www/html/storage \
-type d -exec chmod 755 {} \;
# Clear and cache config in production
if [ "$APP_ENV" = "production" ]; then
runuser -u www-data -- php artisan migrate --force
runuser -u www-data -- php artisan cache:clear # Clear after the migration
runuser -u www-data -- php artisan ninja:design-update
runuser -u www-data -- php artisan optimize
# If first IN run, it needs to be initialized
if [ "$(runuser -u www-data -- php artisan tinker --execute='echo Schema::hasTable("accounts") && !App\Models\Account::all()->first();')" = "1" ]; then
echo "Running initialization..."
runuser -u www-data -- php artisan db:seed --force
if [ -n "${IN_USER_EMAIL}" ] && [ -n "${IN_PASSWORD}" ]; then
runuser -u www-data -- php artisan ninja:create-account --email "${IN_USER_EMAIL}" --password "${IN_PASSWORD}"
else
echo "Initialization failed - Set IN_USER_EMAIL and IN_PASSWORD in .env"
exit 1
fi
fi
echo "Production setup completed"
fi
echo "Starting supervisord..."
fi
exec "$@"

View File

@@ -1,52 +1,39 @@
[unix_http_server]
file=/var/run/supervisor.sock
chmod=0700
[supervisord]
nodaemon=true
user=root
logfile=/var/log/supervisor/supervisord.log
logfile=/dev/null
logfile_maxbytes=0
pidfile=/var/run/supervisord.pid
[rpcinterface:supervisor]
supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix:///var/run/supervisor.sock
[program:php-fpm]
command=/usr/local/sbin/php-fpm -F
autostart=true
autorestart=true
priority=5
stdout_logfile=/dev/stdout
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
redirect_stderr=true
[program:queue-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/html/artisan queue:work --sleep=3 --tries=3 --max-time=3600
command=php /var/www/html/artisan queue:work --sleep=3 --tries=3 --max-time=3600 --verbose
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=www-data
numprocs=2
redirect_stderr=true
stdout_logfile=/dev/stdout
environment=HOME="/var/www"
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
redirect_stderr=true
stopwaitsecs=3600
[program:scheduler]
command=/bin/sh -c "while [ true ]; do (php /var/www/html/artisan schedule:run --verbose --no-interaction &); sleep 60; done"
command=php /var/www/html/artisan schedule:work --verbose
autostart=true
autorestart=true
user=www-data
redirect_stderr=true
stdout_logfile=/dev/stdout
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
redirect_stderr=true

View File

@@ -1 +0,0 @@

View File

@@ -1 +0,0 @@