Skip to content

Commit

Permalink
- Use default laravel nginx and extend it with invoiceninja -specific…
Browse files Browse the repository at this point in the history
… settings

- Overwrite php.ini/php-fpm.ini settings with customized settings
  • Loading branch information
Benjamin Brummer committed Nov 28, 2024
1 parent 687e74c commit b83fb83
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 86 deletions.
2 changes: 0 additions & 2 deletions debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 /
Expand Down
9 changes: 5 additions & 4 deletions debian/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
36 changes: 0 additions & 36 deletions debian/nginx/conf.d/default.conf

This file was deleted.

9 changes: 9 additions & 0 deletions debian/nginx/invoiceninja.conf
Original file line number Diff line number Diff line change
@@ -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 changes: 31 additions & 0 deletions debian/nginx/laravel.conf
Original file line number Diff line number Diff line change
@@ -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;
}
}
29 changes: 0 additions & 29 deletions debian/nginx/nginx.conf

This file was deleted.

7 changes: 0 additions & 7 deletions debian/php/php-fpm.conf
Original file line number Diff line number Diff line change
@@ -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 changes: 1 addition & 8 deletions debian/php/php.ini
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
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
opcache.jit_buffer_size=256M
opcache.jit=1205
opcache.memory_consumption=1024M


post_max_size = 60M
upload_max_filesize = 50M
memory_limit=512M

0 comments on commit b83fb83

Please sign in to comment.