diff --git a/debian/Dockerfile b/debian/Dockerfile index bd1293b..58adffb 100644 --- a/debian/Dockerfile +++ b/debian/Dockerfile @@ -1,10 +1,10 @@ FROM dunglas/frankenphp:1-php8.3-bookworm AS prepare-app RUN curl -s "https://api.github.com/repos/invoiceninja/invoiceninja/releases/latest" | \ - grep -o '"browser_download_url": "[^"]*invoiceninja.tar"' | \ + grep -o '"browser_download_url": "[^"]*invoiceninja.tar.gz"' | \ cut -d '"' -f 4 | \ xargs curl -sL | \ - tar -xz \ + tar -xz --strip-components=1 \ && ln -s ./resources/views/react/index.blade.php ./public/index.html \ # Symlink && php artisan storage:link \ @@ -80,10 +80,6 @@ RUN chown -R ${user}: \ /data/caddy \ /config/caddy -ENTRYPOINT ["/usr/local/bin/init.sh"] - -CMD ["frankenphp", "php-cli", "artisan", "octane:frankenphp"] - # InvoiceNinja COPY --from=prepare-app --chown=${user}:${user} /app /app @@ -91,3 +87,7 @@ COPY --from=prepare-app --chown=${user}:${user} /app /app COPY --chmod=0755 scripts/init.sh /usr/local/bin/init.sh USER ${user} + +ENTRYPOINT ["/usr/local/bin/init.sh"] + +CMD ["frankenphp", "php-cli", "artisan", "octane:frankenphp"] diff --git a/debian/php/php.ini b/debian/php/php.ini index a748d2f..fec5026 100644 --- a/debian/php/php.ini +++ b/debian/php/php.ini @@ -6,10 +6,18 @@ upload_max_filesize=10M [opcache] ; https://www.php.net/manual/en/opcache.installation.php#opcache.installation.recommended opcache.enable_cli=1 -opcache.max_accelerated_files=4000 -opcache.revalidate_freq=60 [jit] ; https://wiki.php.net/rfc/jit_config_defaults opcache.jit=tracing opcache.jit_buffer_size=64M + +[extra] +; https://frankenphp.dev/docs/performance/#php-performance +; http://symfony.com/doc/current/performance.html +opcache.memory_consumption=256 +opcache.max_accelerated_files=20000 +opcache.preload=/app/preload.php +opcache.validate_timestamps=0 +realpath_cache_size = 4096K +realpath_cache_ttl = 600 diff --git a/debian/scripts/init.sh b/debian/scripts/init.sh index 40a3ed5..39aea60 100755 --- a/debian/scripts/init.sh +++ b/debian/scripts/init.sh @@ -48,7 +48,7 @@ if [ "$*" = 'frankenphp php-cli artisan octane:frankenphp' ] || [ "${1#-}" != "$ frankenphp php-cli artisan migrate --force # If first IN run, it needs to be initialized - if [ "$(frankenphp php-cli artisan tinker --execute='echo Schema::hasTable("accounts") && !App\Models\Account::all()->first();')" = "1" ]; then + if [ "$(php -d opcache.preload='' artisan tinker --execute='echo Schema::hasTable("accounts") && !App\Models\Account::all()->first();')" = "1" ]; then echo "Running initialization..." frankenphp php-cli artisan db:seed --force