- Use default laravel nginx and extend it with invoiceninja -specific settings

- Overwrite php.ini/php-fpm.ini settings with customized settings
This commit is contained in:
Benjamin Brummer
2024-11-28 14:04:11 +01:00
parent 687e74c983
commit b83fb831b9
8 changed files with 46 additions and 86 deletions

2
debian/Dockerfile vendored
View File

@@ -91,8 +91,6 @@ RUN install-php-extensions \
# Configure PHP
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
COPY php/php.ini /usr/local/etc/php/conf.d/app.ini
COPY php/php-fpm.conf /usr/local/etc/php-fpm.d/www.conf
# Copy scripts
COPY rootfs /

View File

@@ -13,8 +13,10 @@ services:
env_file:
- ./.env
volumes:
- ./.env:/var/www/html/.env
- ./supervisor/supervisord.conf:/etc/supervisor/conf.d/supervisord.conf
- ./.env:/var/www/html/.env:ro
- ./php/php.ini:/usr/local/etc/php/conf.d/zzz-php.ini:ro
- ./php/php-fpm.conf:/usr/local/etc/php-fpm.d/zzz-php-fpm.conf:ro
- ./supervisor/supervisord.conf:/etc/supervisor/conf.d/supervisord.conf:ro
- app_storage:/var/www/html/storage
- app_cache:/var/www/html/bootstrap/cache
- image_public:/var/www/html/public:ro
@@ -33,8 +35,7 @@ services:
ports:
- "80:80"
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d:ro
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx:/etc/nginx/nginx.conf:ro
- app_storage:/var/www/html/storage:ro
- image_public:/var/www/html/public:ro
networks:

View File

@@ -1,36 +0,0 @@
server {
error_log /var/log/nginx/error.log debug;
access_log /var/log/nginx/access.log;
listen 80 default_server;
server_name _;
server_tokens off;
root /var/www/html/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;
}
}

9
debian/nginx/invoiceninja.conf vendored Normal file
View File

@@ -0,0 +1,9 @@
client_max_body_size 100M;
client_body_buffer_size 100M;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
gzip on;
server_tokens off;

31
debian/nginx/laravel.conf vendored Normal file
View File

@@ -0,0 +1,31 @@
server {
listen 80 default_server;
server_name _;
root /var/www/html/public;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
index index.php;
charset utf-8;
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; }
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_pass app:9000;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
}

View File

@@ -1,29 +0,0 @@
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log;
sendfile on;
keepalive_timeout 65;
gzip on;
client_max_body_size 100M;
client_body_buffer_size 100M;
include /etc/nginx/conf.d/*.conf;
}

View File

@@ -1,9 +1,2 @@
[www]
user = www-data
group = www-data
listen = 0.0.0.0:9000
pm = dynamic
pm.max_children = 10
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3

9
debian/php/php.ini vendored
View File

@@ -1,13 +1,8 @@
session.auto_start = Off
short_open_tag = Off
error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_DEPRECATED
memory_limit=512M
opcache.enable=1
opcache.preload=/var/www/html/preload.php
opcache.preload_user=www-data
; ; The OPcache shared memory storage size.
opcache.max_accelerated_files=300000
opcache.validate_timestamps=1
opcache.revalidate_freq=30
@@ -15,7 +10,5 @@ opcache.jit_buffer_size=256M
opcache.jit=1205
opcache.memory_consumption=1024M
post_max_size = 60M
upload_max_filesize = 50M
memory_limit=512M