the middle of the idiots
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
FROM php:8.2-apache
|
||||
FROM php:8.2-fpm
|
||||
|
||||
# Install system dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
@@ -25,10 +25,9 @@ WORKDIR /var/www/html
|
||||
|
||||
# Set permissions
|
||||
RUN chown -R www-data:www-data /var/www/html
|
||||
RUN a2enmod rewrite
|
||||
|
||||
# Expose port
|
||||
EXPOSE 80
|
||||
# Expose port for PHP-FPM
|
||||
EXPOSE 9000
|
||||
|
||||
# Start Apache
|
||||
CMD ["apache2-foreground"]
|
||||
# Start PHP-FPM
|
||||
CMD ["php-fpm"]
|
||||
9
qwen/php/docker/nginx/Dockerfile
Normal file
9
qwen/php/docker/nginx/Dockerfile
Normal file
@@ -0,0 +1,9 @@
|
||||
# docker/nginx/Dockerfile
|
||||
FROM nginx:alpine
|
||||
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
COPY default.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
41
qwen/php/docker/nginx/default.conf
Normal file
41
qwen/php/docker/nginx/default.conf
Normal file
@@ -0,0 +1,41 @@
|
||||
# docker/nginx/default.conf
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
root /var/www/html/public;
|
||||
index index.php index.html;
|
||||
|
||||
# Serve static files directly
|
||||
location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
|
||||
expires 1y;
|
||||
add_header Cache-Control "public, immutable";
|
||||
}
|
||||
|
||||
# Main location block for PHP files
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$query_string;
|
||||
}
|
||||
|
||||
# PHP-FPM configuration
|
||||
location ~ \.php$ {
|
||||
fastcgi_pass php:9000;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
}
|
||||
|
||||
# Security: deny access to hidden files
|
||||
location ~ /\. {
|
||||
deny all;
|
||||
}
|
||||
|
||||
# Security: deny access to composer files
|
||||
location ~ /composer\.(json|lock) {
|
||||
deny all;
|
||||
}
|
||||
|
||||
# Security: deny access to sensitive files
|
||||
location ~ \.(env|htaccess|git) {
|
||||
deny all;
|
||||
}
|
||||
}
|
||||
28
qwen/php/docker/nginx/nginx.conf
Normal file
28
qwen/php/docker/nginx/nginx.conf
Normal file
@@ -0,0 +1,28 @@
|
||||
# docker/nginx/nginx.conf
|
||||
user nginx;
|
||||
worker_processes auto;
|
||||
error_log /var/log/nginx/error.log warn;
|
||||
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;
|
||||
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
tcp_nodelay on;
|
||||
keepalive_timeout 65;
|
||||
types_hash_max_size 2048;
|
||||
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
}
|
||||
@@ -1,6 +1,38 @@
|
||||
; Custom PHP configuration
|
||||
memory_limit = 256M
|
||||
upload_max_filesize = 64M
|
||||
post_max_size = 64M
|
||||
max_execution_time = 300
|
||||
max_input_vars = 3000
|
||||
; docker/php.ini
|
||||
; PHP configuration for development environment
|
||||
|
||||
; Enable opcache for better performance
|
||||
opcache.enable=1
|
||||
opcache.memory_consumption=256
|
||||
opcache.max_accelerated_files=7963
|
||||
opcache.revalidate_freq=0
|
||||
opcache.fast_shutdown=1
|
||||
|
||||
; Development settings
|
||||
display_errors=On
|
||||
display_startup_errors=On
|
||||
error_reporting=E_ALL
|
||||
log_errors=On
|
||||
html_errors=Off
|
||||
|
||||
; Memory limits
|
||||
memory_limit=512M
|
||||
max_execution_time=300
|
||||
max_input_time=300
|
||||
max_input_vars=5000
|
||||
|
||||
; File upload settings
|
||||
file_uploads=On
|
||||
upload_max_filesize=64M
|
||||
post_max_size=64M
|
||||
|
||||
; Session settings
|
||||
session.auto_start=Off
|
||||
session.use_only_cookies=On
|
||||
session.use_strict_mode=On
|
||||
session.cookie_httponly=On
|
||||
session.cookie_secure=Off
|
||||
session.use_cookies=On
|
||||
|
||||
; Security settings
|
||||
expose_php=Off
|
||||
Reference in New Issue
Block a user