Compare commits

...

10 Commits

Author SHA1 Message Date
David Bomba
9944d43f0b Merge pull request #765 from stavros-k/patch-1
Update init.sh
2025-07-07 08:42:59 +10:00
Stavros Kois
5eefcecf47 Update init.sh
Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>
2025-07-03 13:57:12 +03:00
David Bomba
f80e7f2ec3 Merge pull request #752 from benbrummer/octane
saxon defaults now to 12.5.0
2025-05-11 09:44:33 +10:00
benbrummer
f5821630fa saxon defaults now to 12.5.0
Signed-off-by: benbrummer <info@benjamin-brummer.de>
2025-05-10 10:58:40 +02:00
David Bomba
1848f11a36 Merge pull request #751 from benbrummer/octane
align octane to debian
2025-05-08 19:41:31 +10:00
Benjamin Brummer
f96d4d4aa0 image versions as ARGs 2025-05-08 06:58:11 +00:00
Benjamin Brummer
5d29d3a052 align init.sh with invoiceninja-debian 2025-05-08 06:43:50 +00:00
Benjamin Brummer
0c607953ec HEALTHCHECK for laravel 2025-05-08 06:43:23 +00:00
Benjamin Brummer
ebc6c3642a remove cache volume and healthcheck configuration 2025-05-08 06:43:03 +00:00
David Bomba
ec35498159 set conditional for chrome / chromium path 2025-03-25 12:04:11 +11:00
4 changed files with 23 additions and 10 deletions

2
debian/.env vendored
View File

@@ -57,6 +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-stable

12
debian/Dockerfile vendored
View File

@@ -1,4 +1,8 @@
FROM dunglas/frankenphp:1-php8.3-bookworm AS prepare-app
ARG PHP_VERSION=8.3
ARG FRANKENPHP_VERSION=1
ARG DEBIAN_VERSION=bookworm
FROM dunglas/frankenphp:${FRANKENPHP_VERSION}-php${PHP_VERSION}-${DEBIAN_VERSION} AS prepare-app
RUN curl -sL "https://github.com/invoiceninja/invoiceninja/releases/latest/download/invoiceninja.tar.gz" | \
tar -xz \
@@ -11,13 +15,13 @@ RUN curl -sL "https://github.com/invoiceninja/invoiceninja/releases/latest/downl
# ==================
# InvoiceNinja image
# ==================
FROM dunglas/frankenphp:1-php8.3-bookworm
FROM dunglas/frankenphp:${FRANKENPHP_VERSION}-php${PHP_VERSION}-${DEBIAN_VERSION}
ARG user=ninja
# PHP modules
ARG php_require="bcmath gd mbstring pdo_mysql zip"
ARG php_suggest="exif imagick intl pcntl soap saxon-12.5.0"
ARG php_suggest="exif imagick intl pcntl saxon soap"
ARG php_extra="opcache"
# Create a system user UID/GID=999
@@ -85,6 +89,8 @@ COPY --chmod=0755 scripts/init.sh /usr/local/bin/init.sh
USER ${user}
HEALTHCHECK --start-period=10s CMD curl -f http://localhost/health
ENTRYPOINT ["/usr/local/bin/init.sh"]
CMD ["frankenphp", "php-cli", "artisan", "octane:frankenphp"]

View File

@@ -9,7 +9,6 @@ x-logging: &default-logging
x-app-volumes: &volumes
volumes:
- ./.env:/app/.env
- app_cache:/var/www/html/bootstrap/cache
- app_storage:/app/storage
- caddy_data:/data
@@ -31,9 +30,6 @@ services:
environment:
LARAVEL_ROLE: app
<<: *volumes
# HEALTHCHECK from frankenphp image
healthcheck:
start_period: 180s
depends_on:
mysql:
condition: service_healthy
@@ -143,7 +139,6 @@ services:
# logging: *default-logging
volumes:
app_cache:
app_storage:
caddy_data:
mysql_data:

View File

@@ -3,6 +3,12 @@
# Fallback to app
role=${LARAVEL_ROLE:-app}
# Set PDF generation browser path based on architecture
export SNAPPDF_CHROMIUM_PATH=/usr/bin/google-chrome-stable
if [ "$(dpkg --print-architecture)" = "arm64" ]; then
export SNAPPDF_CHROMIUM_PATH=/usr/bin/chromium
fi
# Check for default CMD, flag(s) or empty CMD
if [ "$*" = 'frankenphp php-cli artisan octane:frankenphp' ] || [ "${1#-}" != "$1" ] || [ "$#" -eq "0" ]; then
@@ -38,6 +44,12 @@ if [ "$*" = 'frankenphp php-cli artisan octane:frankenphp' ] || [ "${1#-}" != "$
if [ "${role}" = "app" ]; then
cmd="frankenphp php-cli artisan octane:frankenphp"
# Check for required folders and create if needed, relevant for bind mounts
# It is not possible to chown, as we are not executing this script as root
[ -d /app/storage/framework/sessions ] || mkdir -p /app/storage/framework/sessions
[ -d /app/storage/framework/views ] || mkdir -p /app/storage/framework/views
[ -d /app/storage/framework/cache ] || mkdir -p /app/storage/framework/cache
if [ "$APP_ENV" = "production" ]; then
frankenphp php-cli artisan optimize
fi
@@ -48,7 +60,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 [ "$(php -d opcache.preload='' artisan tinker --execute='echo Schema::hasTable("accounts") && !App\Models\Account::all()->first();')" = "1" ]; then
if [ "$(frankenphp php-cli artisan tinker --execute='echo Schema::hasTable("accounts") && !App\Models\Account::all()->first();')" = "1" ]; then
echo "Running initialization..."
frankenphp php-cli artisan db:seed --force