diff --git a/alpine/5/Dockerfile b/alpine/5/Dockerfile index cf5dea6..5b573ab 100644 --- a/alpine/5/Dockerfile +++ b/alpine/5/Dockerfile @@ -1,42 +1,44 @@ -ARG PHP_VERSION=8.2 +ARG PHP_VERSION=8.3 ARG BAK_STORAGE_PATH=/var/www/app/docker-backup-storage/ ARG BAK_PUBLIC_PATH=/var/www/app/docker-backup-public/ # Get Invoice Ninja and install nodejs packages -FROM --platform=$BUILDPLATFORM node:lts-alpine as nodebuild +FROM --platform=$BUILDPLATFORM php:${PHP_VERSION}-fpm-alpine AS nodebuild # Download Invoice Ninja ARG INVOICENINJA_VERSION ARG REPOSITORY=invoiceninja/invoiceninja ARG FILENAME=invoiceninja.tar -RUN set -eux; apk add curl unzip grep - -RUN 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 -LJO "$DOWNLOAD_URL" && \ - mv invoiceninja.tar /tmp/ninja.tar +RUN mkdir -p /var/www/app # Extract Invoice Ninja -RUN mkdir -p /var/www/app \ - && tar -xvf /tmp/ninja.tar -C /var/www/app/ \ - && mkdir -p /var/www/app/public/logo /var/www/app/storage - +RUN apk add --no-cache curl \ + && curl -s "https://api.github.com/repos/invoiceninja/invoiceninja/releases/latest" | \ + grep -o '"browser_download_url": "[^"]*invoiceninja.tar.gz"' | \ + cut -d '"' -f 4 | \ + xargs curl -sL | \ + tar -xz --strip-components=1 -C /var/www/app/ \ + && apk --purge del curl + +RUN mkdir -p /var/www/app/public/logo /var/www/app/storage + WORKDIR /var/www/app # Prepare php image -FROM php:${PHP_VERSION}-fpm-alpine as phpbuild +FROM php:${PHP_VERSION}-fpm-alpine AS phpbuild LABEL maintainer="David Bomba " +ARG php_require="bcmath gd pdo_mysql zip" +ARG php_suggest="exif imagick intl pcntl soap" +ARG php_extra="opcache" + # Adding caching_sha2_password.so # With this we get native support for caching_sha2_password RUN apk add --no-cache mariadb-connector-c -RUN mv /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini - -# Install PHP extensions -# https://hub.docker.com/r/mlocati/php-extension-installer/tags -COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ +RUN ln -s "${PHP_INI_DIR}/php.ini-production" "${PHP_INI_DIR}/php.ini" # Install chromium RUN set -eux; \ @@ -48,18 +50,11 @@ RUN set -eux; \ ttf-freefont \ ttf-dejavu -RUN install-php-extensions \ - bcmath \ - exif \ - gd \ - gmp \ - mysqli \ - opcache \ - pdo_mysql \ - zip \ - intl \ - @composer \ - && rm /usr/local/bin/install-php-extensions +# Install PHP extensions +RUN ( curl -sSLf https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions -o - || echo 'return 1' ) | sh -s \ + ${php_require} \ + ${php_suggest} \ + ${php_extra} # Copy files COPY rootfs / diff --git a/alpine/5/rootfs/etc/supervisord.conf b/alpine/5/rootfs/etc/supervisord.conf index 3ca2d92..b4817b9 100644 --- a/alpine/5/rootfs/etc/supervisord.conf +++ b/alpine/5/rootfs/etc/supervisord.conf @@ -6,7 +6,6 @@ logfile_maxbytes=0 loglevel=info [program:php-fpm] -redirect_stderr=true stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr @@ -15,7 +14,6 @@ command=php-fpm [program:scheduler] autorestart=true -redirect_stderr=true stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr @@ -25,7 +23,6 @@ command=php artisan schedule:work [program:queue-worker] process_name=%(program_name)s_%(process_num)02d autorestart=true -redirect_stderr=true stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr diff --git a/docker-compose.yml b/docker-compose.yml index 187a742..ab26b26 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3.7' - services: server: image: nginx @@ -23,7 +21,9 @@ services: - "in5.localhost:192.168.0.124 " #host and ip app: - image: invoiceninja/invoiceninja:5 + build: + context: ./alpine/5 + image: invoiceninja/invoiceninja:${TAG:-5} env_file: env restart: always volumes: