Merge pull request #690 from benbrummer/octane

Octane
This commit is contained in:
David Bomba
2025-01-15 08:18:57 +11:00
committed by GitHub
3 changed files with 17 additions and 9 deletions

12
debian/Dockerfile vendored
View File

@@ -1,10 +1,10 @@
FROM dunglas/frankenphp:1-php8.3-bookworm AS prepare-app FROM dunglas/frankenphp:1-php8.3-bookworm AS prepare-app
RUN curl -s "https://api.github.com/repos/invoiceninja/invoiceninja/releases/latest" | \ 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 | \ cut -d '"' -f 4 | \
xargs curl -sL | \ xargs curl -sL | \
tar -xz \ tar -xz --strip-components=1 \
&& ln -s ./resources/views/react/index.blade.php ./public/index.html \ && ln -s ./resources/views/react/index.blade.php ./public/index.html \
# Symlink # Symlink
&& php artisan storage:link \ && php artisan storage:link \
@@ -80,10 +80,6 @@ RUN chown -R ${user}: \
/data/caddy \ /data/caddy \
/config/caddy /config/caddy
ENTRYPOINT ["/usr/local/bin/init.sh"]
CMD ["frankenphp", "php-cli", "artisan", "octane:frankenphp"]
# InvoiceNinja # InvoiceNinja
COPY --from=prepare-app --chown=${user}:${user} /app /app 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 COPY --chmod=0755 scripts/init.sh /usr/local/bin/init.sh
USER ${user} USER ${user}
ENTRYPOINT ["/usr/local/bin/init.sh"]
CMD ["frankenphp", "php-cli", "artisan", "octane:frankenphp"]

12
debian/php/php.ini vendored
View File

@@ -6,10 +6,18 @@ upload_max_filesize=10M
[opcache] [opcache]
; https://www.php.net/manual/en/opcache.installation.php#opcache.installation.recommended ; https://www.php.net/manual/en/opcache.installation.php#opcache.installation.recommended
opcache.enable_cli=1 opcache.enable_cli=1
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
[jit] [jit]
; https://wiki.php.net/rfc/jit_config_defaults ; https://wiki.php.net/rfc/jit_config_defaults
opcache.jit=tracing opcache.jit=tracing
opcache.jit_buffer_size=64M 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

View File

@@ -48,7 +48,7 @@ if [ "$*" = 'frankenphp php-cli artisan octane:frankenphp' ] || [ "${1#-}" != "$
frankenphp php-cli artisan migrate --force frankenphp php-cli artisan migrate --force
# If first IN run, it needs to be initialized # 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..." echo "Running initialization..."
frankenphp php-cli artisan db:seed --force frankenphp php-cli artisan db:seed --force