File tree Expand file tree Collapse file tree 8 files changed +47
-8
lines changed Expand file tree Collapse file tree 8 files changed +47
-8
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ export MYSQL_DATABASE=${WORDPRESS_DB_NAME}
1313export MYSQL_USER = ${ WORDPRESS_DB_USER }
1414export MYSQL_PASSWORD = ${ WORDPRESS_DB_PASSWORD }
1515export MYSQL_ROOT_PASSWORD = rootpassword123!
16+ export NPP_MYSQL_CONF = ./mysql/50-npp-server.cnf
1617
1718# Nginx Settings
1819export NGINX_CACHE = nginx_cache
Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ services:
2020 - ${NPP_FPM_CONF}:/usr/local/etc/php-fpm.d/www.conf
2121 - ${FPM_DOCKER_CONF}:/usr/local/etc/php-fpm.d/zz-docker.conf
2222 - ${NPP_PHP_CONF}:/usr/local/etc/php/conf.d/npp.ini
23+ - /etc/localtime:/etc/localtime:ro
24+ - /etc/timezone:/etc/timezone:ro
2325 environment :
2426 - WORDPRESS_DB_HOST=${WORDPRESS_DB_HOST}
2527 - WORDPRESS_DB_USER=${WORDPRESS_DB_USER}
@@ -68,8 +70,16 @@ services:
6870 env_file :
6971 - .env
7072 restart : unless-stopped
73+ cap_add :
74+ - SYS_NICE
75+ security_opt :
76+ - apparmor:unconfined
77+ - seccomp:unconfined
7178 volumes :
7279 - ${MYSQL_HOME}:/var/lib/mysql
80+ - ${NPP_MYSQL_CONF}:/etc/mysql/conf.d/50-npp-server.cnf
81+ - /etc/localtime:/etc/localtime:ro
82+ - /etc/timezone:/etc/timezone:ro
7383 environment :
7484 - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
7585 - MYSQL_DATABASE=${MYSQL_DATABASE}
@@ -100,6 +110,8 @@ services:
100110 - ${NPP_NGINX_CONF}:/etc/nginx/conf.d/npp.conf
101111 - ${NPP_NGINX_PARAMS_CONF}:/etc/nginx/fastcgi_params
102112 - ${NGINX_SSL_CERTS}:/etc/ssl:ro
113+ - /etc/localtime:/etc/localtime:ro
114+ - /etc/timezone:/etc/timezone:ro
103115 environment :
104116 - NPP_WEB_ROOT=${NPP_WEB_ROOT_}
105117 - NPP_USER=${NPP_USER_}
Original file line number Diff line number Diff line change @@ -11,4 +11,5 @@ pm.max_spare_servers = 4
1111pm.max_requests = 750
1212rlimit_files = 131072
1313rlimit_core = unlimited
14+ listen.backlog = 65535
1415php_admin_value[memory_limit] = 512M
Original file line number Diff line number Diff line change 1+ [mysqld]
2+ character-set-server = utf8mb4 # UTF-8 character set
3+ skip-external-locking # Skip external locking for speed
4+ skip-log-bin # Disable binary logging
5+ wait_timeout = 1800 # Timeout for inactive connections (30 min)
6+ max_allowed_packet = 128M # Max packet size for queries
7+ innodb_flush_log_at_trx_commit = 2 # InnoDB log flush for performance
8+ innodb_dedicated_server = ON # Enable InnoDB optimizations
9+ innodb_log_buffer_size = 32M # InnoDB log buffer size
10+ max_connections = 100 # Max allowed connections
11+ tmp_table_size = 32M # Max temp table size in memory
12+ max_heap_table_size = 32M # Max in-memory heap table size
Original file line number Diff line number Diff line change @@ -35,5 +35,10 @@ COLOR_WHITE='\033[0;97m'
3535COLOR_BLACK=' \033[0;30m'
3636COLOR_LIGHT_CYAN=' \033[0;96m'
3737
38+ # Fix permissions for consistency
39+ chown -R root:root /etc/mysql/conf.d &&
40+ echo -e " ${COLOR_GREEN}${COLOR_BOLD} NPP-DB:${COLOR_RESET} Permissions fixed successfully!" ||
41+ echo -e " ${COLOR_RED}${COLOR_BOLD} NPP-DB:${COLOR_RESET} Failed to fix permissions!"
42+
3843# Start mysqld
39- exec /usr/local/bin/docker-entrypoint.sh " $@ " > /dev/null 2>&1
44+ exec /usr/local/bin/docker-entrypoint.sh " $@ "
Original file line number Diff line number Diff line change 9090 echo -e " ${COLOR_GREEN}${COLOR_BOLD} NPP-NGINX:${COLOR_RESET} User ${COLOR_LIGHT_CYAN}${NGINX_WEB_USER}${COLOR_RESET} is already in group ${COLOR_LIGHT_CYAN}${NPP_USER}${COLOR_RESET} Skipping.."
9191fi
9292
93+ # Fix permissions for consistency
94+ chown -R root:root /etc/nginx &&
95+ echo -e " ${COLOR_GREEN}${COLOR_BOLD} NPP-NGINX:${COLOR_RESET} Permissions fixed successfully!" ||
96+ echo -e " ${COLOR_RED}${COLOR_BOLD} NPP-NGINX:${COLOR_RESET} Failed to fix permissions!"
97+
9398sleep 3
9499
95100# Congratulatory Header
@@ -118,4 +123,4 @@ echo -e "\n${COLOR_YELLOW}━━━━━━━━━━━━━━━━━━
118123echo -e " \n${COLOR_RED}${COLOR_BOLD} ☪︎${COLOR_RESET} ${COLOR_GREEN}${COLOR_BOLD} NE MUTLU TÜRK'ÜM DİYENE!${COLOR_RESET} "
119124
120125# Start nginx
121- exec /docker-entrypoint.sh " $@ " > /dev/null 2>&1
126+ exec /docker-entrypoint.sh " $@ "
Original file line number Diff line number Diff line change @@ -23,11 +23,6 @@ server {
2323 root /var/www/html;
2424 index index.php index.html index.htm;
2525
26- # Logging
27- ##########
28- access_log /var/log/nginx/npp.com.access.log;
29- error_log /var/log/nginx/npp.com.error.log;
30-
3126 # Cache Settings
3227 #################
3328 set $skip_cache 0;
Original file line number Diff line number Diff line change 8484# Log that the bindfs mount was successful
8585echo -e " ${COLOR_GREEN}${COLOR_BOLD} NPP-WP:${COLOR_RESET} The Nginx Cache Path: ${COLOR_LIGHT_CYAN}${NPP_NGINX_CACHE_PATH}${COLOR_RESET} has been successfully mounted to ${COLOR_LIGHT_CYAN}${MOUNT_DIR}${COLOR_RESET} with ${COLOR_CYAN} UID:${NPP_UID}${COLOR_RESET} and ${COLOR_CYAN} GID:${NPP_GID}${COLOR_RESET} ."
8686
87+ # Fix permissions for consistency
88+ chown -R root:root \
89+ /etc/nginx \
90+ /usr/local/etc/php-fpm.d \
91+ /usr/local/etc/php/conf.d &&
92+ echo -e " ${COLOR_GREEN}${COLOR_BOLD} NPP-WP:${COLOR_RESET} Permissions fixed successfully!" ||
93+ echo -e " ${COLOR_RED}${COLOR_BOLD} NPP-WP:${COLOR_RESET} Failed to fix permissions!"
94+
8795# Wait for the 'wordpress-db' to be ready
8896until mysql -h wordpress-db -u" ${WORDPRESS_DB_USER} " -p" ${WORDPRESS_DB_PASSWORD} " " ${WORDPRESS_DB_NAME} " -e " SELECT 1" > /dev/null 2>&1 ; do
8997 echo -e " ${COLOR_YELLOW}${COLOR_BOLD} NPP-WP:${COLOR_RESET} The ${COLOR_LIGHT_CYAN} MySQL database${COLOR_RESET} is not available yet. Retrying..."
92100echo -e " ${COLOR_GREEN}${COLOR_BOLD} NPP-WP:${COLOR_RESET} The ${COLOR_LIGHT_CYAN} MySQL database${COLOR_RESET} is ready! Proceeding..."
93101
94102# Start php-fpm
95- exec /usr/local/bin/docker-entrypoint.sh " $@ " > /dev/null 2>&1
103+ exec /usr/local/bin/docker-entrypoint.sh " $@ "
You can’t perform that action at this time.
0 commit comments