-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #715 from invoiceninja/revert-689-master
Revert "Align alpine to debian and octane for maintenance"
- Loading branch information
Showing
14 changed files
with
168 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,65 @@ | ||
ARG PHP_VERSION=8.3 | ||
ARG ALPINE_VERSION=3.20 | ||
ARG PHP_VERSION=8.2 | ||
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 php:${PHP_VERSION}-fpm-alpine${ALPINE_VERSION} AS nodebuild | ||
FROM --platform=$BUILDPLATFORM node:lts-alpine as nodebuild | ||
|
||
# Download Invoice Ninja | ||
ARG INVOICENINJA_VERSION | ||
ARG REPOSITORY=invoiceninja/invoiceninja | ||
ARG FILENAME=invoiceninja.tar | ||
|
||
RUN mkdir -p /var/www/app | ||
RUN set -eux; apk add curl unzip grep | ||
|
||
# Extract Invoice Ninja | ||
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 | ||
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 | ||
|
||
# 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 | ||
|
||
WORKDIR /var/www/app | ||
|
||
# Prepare php image | ||
FROM php:${PHP_VERSION}-fpm-alpine${ALPINE_VERSION} AS phpbuild | ||
FROM php:${PHP_VERSION}-fpm-alpine as phpbuild | ||
|
||
LABEL maintainer="David Bomba <[email protected]>" | ||
|
||
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 ln -s "${PHP_INI_DIR}/php.ini-production" "${PHP_INI_DIR}/php.ini" | ||
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/ | ||
|
||
# Install chromium | ||
RUN set -eux; \ | ||
apk add --no-cache \ | ||
font-isas-misc \ | ||
supervisor \ | ||
mariadb-client \ | ||
mariadb-connector-c \ | ||
mysql-client \ | ||
chromium \ | ||
# font-noto-cjk-extra \ | ||
# font-wqy-zenhei \ | ||
ttf-freefont \ | ||
ttf-dejavu | ||
|
||
# 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} | ||
RUN install-php-extensions \ | ||
bcmath \ | ||
exif \ | ||
gd \ | ||
gmp \ | ||
mysqli \ | ||
opcache \ | ||
pdo_mysql \ | ||
zip \ | ||
intl \ | ||
@composer \ | ||
&& rm /usr/local/bin/install-php-extensions | ||
|
||
# Copy files | ||
COPY rootfs / | ||
|
@@ -82,6 +87,8 @@ ENV BAK_STORAGE_PATH $BAK_STORAGE_PATH | |
ENV BAK_PUBLIC_PATH $BAK_PUBLIC_PATH | ||
COPY --from=nodebuild --chown=$INVOICENINJA_USER:$INVOICENINJA_USER /var/www/app /var/www/app | ||
|
||
RUN rm -rf /var/www/app/ui | ||
|
||
USER $UID | ||
WORKDIR /var/www/app | ||
|
||
|
@@ -99,7 +106,7 @@ ARG BAK_PUBLIC_PATH | |
RUN mv /var/www/app/storage $BAK_STORAGE_PATH \ | ||
&& mv /var/www/app/public $BAK_PUBLIC_PATH | ||
|
||
FROM phpbuild AS prod | ||
FROM phpbuild as prod | ||
|
||
COPY --from=dependencybuild --chown=$INVOICENINJA_USER:$INVOICENINJA_USER /var/www/app /var/www/app | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
; How often (in seconds) to check file timestamps for changes to the shared | ||
; memory storage allocation. ("1" means validate once per second, but only | ||
; once per request. "0" means always validate) | ||
;opcache.revalidate_freq=2 | ||
opcache.revalidate_freq=60 | ||
|
||
# http://symfony.com/doc/current/performance.html | ||
; Duration of time, in seconds for which to cache realpath information for a given | ||
; file or directory. For systems with rarely changing files, consider increasing this | ||
; value. | ||
; http://php.net/realpath-cache-ttl | ||
;realpath_cache_ttl = 120 | ||
realpath_cache_ttl = 600 | ||
|
||
; Maximum allowed size for uploaded files. | ||
; http://php.net/upload-max-filesize | ||
upload_max_filesize = 8M |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
server { | ||
listen 80 default_server; | ||
server_name _; | ||
|
||
server_tokens off; | ||
|
||
client_max_body_size 100M; | ||
|
||
root /var/www/app/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; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
session.auto_start = Off | ||
short_open_tag = Off | ||
|
||
error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_DEPRECATED | ||
|
||
; opcache.enable_cli=1 | ||
; opcache.fast_shutdown=1 | ||
; opcache.memory_consumption=256 | ||
; opcache.interned_strings_buffer=8 | ||
; opcache.max_accelerated_files=4000 | ||
; opcache.revalidate_freq=60 | ||
; # http://symfony.com/doc/current/performance.html | ||
; realpath_cache_size = 4096K | ||
; realpath_cache_ttl = 600 | ||
|
||
memory_limit = 2G | ||
post_max_size = 60M | ||
upload_max_filesize = 50M |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,21 @@ | ||
[core] | ||
; https://www.php.net/manual/en/ini.core.php | ||
post_max_size=10M | ||
upload_max_filesize=10M | ||
session.auto_start = Off | ||
short_open_tag = Off | ||
|
||
[opcache] | ||
; https://www.php.net/manual/en/opcache.installation.php#opcache.installation.recommended | ||
opcache.enable_cli=1 | ||
error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_DEPRECATED | ||
|
||
[jit] | ||
; https://wiki.php.net/rfc/jit_config_defaults | ||
opcache.jit=tracing | ||
opcache.jit_buffer_size=64M | ||
; opcache.enable=1 | ||
; opcache.preload=/var/www/app/preload.php | ||
; opcache.preload_user=www-data | ||
|
||
[extra] | ||
; http://symfony.com/doc/current/performance.html | ||
opcache.memory_consumption=256 | ||
opcache.max_accelerated_files=20000 | ||
opcache.preload=/var/www/app/preload.php | ||
opcache.validate_timestamps=0 | ||
realpath_cache_size=4096K | ||
realpath_cache_ttl=600 | ||
; ; 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 |
Oops, something went wrong.