Skip to content

Commit

Permalink
Fix bugs and defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
ostefano committed Dec 6, 2024
1 parent 9381b46 commit 9bb03ea
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
5 changes: 5 additions & 0 deletions core/files/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ export PHP_UPLOAD_MAX_FILESIZE=${PHP_UPLOAD_MAX_FILESIZE:-50M}
export PHP_POST_MAX_SIZE=${PHP_POST_MAX_SIZE:-50M}
export PHP_MAX_INPUT_TIME=${PHP_MAX_INPUT_TIME:-300}

export PHP_FCGI_CHILDREN=${PHP_FCGI_CHILDREN:-5}
export PHP_FCGI_START_SERVERS=${PHP_FCGI_START_SERVERS:-2}
export PHP_FCGI_SPARE_SERVERS=${PHP_FCGI_SPARE_SERVERS:-1}
export PHP_FCGI_MAX_REQUESTS=${PHP_FCGI_MAX_REQUESTS:-0}

export PHP_SESSION_TIMEOUT=${PHP_SESSION_TIMEOUT:-60}
export PHP_SESSION_COOKIE_TIMEOUT=${PHP_SESSION_COOKIE_TIMEOUT:-10080}
export PHP_SESSION_DEFAULTS=${PHP_SESSION_DEFAULTS:-php}
Expand Down
2 changes: 1 addition & 1 deletion core/files/entrypoint_nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ init_nginx() {
if [[ "$FASTCGI_STATUS_LISTEN" != "" ]]; then
echo "... enabling php-fpm status page"
ln -s /etc/nginx/sites-available/php-fpm-status /etc/nginx/sites-enabled/php-fpm-status
sed -i -E "s/ listen [^;]+/ listen $FASTCGI_STATUS_LISTEN" /etc/nginx/sites-enabled/php-fpm-status
sed -i -E "s/ listen [^;]+/ listen $FASTCGI_STATUS_LISTEN/" /etc/nginx/sites-enabled/php-fpm-status
elif [[ -f /etc/nginx/sites-enabled/php-fpm-status ]]; then
echo "... disabling php-fpm status page"
rm /etc/nginx/sites-enabled/php-fpm-status
Expand Down
2 changes: 1 addition & 1 deletion core/files/etc/nginx/sites-available/php-fpm-status
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ server {
include fastcgi_params;
fastcgi_pass unix:/run/php/php-fpm-status.sock;
}
}
}
6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,18 @@ services:
- "FASTCGI_READ_TIMEOUT=${FASTCGI_READ_TIMEOUT:-300s}"
- "FASTCGI_SEND_TIMEOUT=${FASTCGI_SEND_TIMEOUT:-300s}"
- "FASTCGI_CONNECT_TIMEOUT=${FASTCGI_CONNECT_TIMEOUT:-300s}"
- "FASTCGI_STATUS_LISTEN=${FASTCGI_STATUS_LISTEN}"
# PHP settings
- "PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT:-2048M}"
- "PHP_MAX_EXECUTION_TIME=${PHP_MAX_EXECUTION_TIME:-300}"
- "PHP_UPLOAD_MAX_FILESIZE=${PHP_UPLOAD_MAX_FILESIZE:-50M}"
- "PHP_POST_MAX_SIZE=${PHP_POST_MAX_SIZE:-50M}"
- "PHP_MAX_INPUT_TIME:${PHP_MAX_INPUT_TIME:-300}"
# PHP FPM pool setup
- "PHP_FCGI_CHILDREN=${PHP_FCGI_CHILDREN:-5}"
- "PHP_FCGI_START_SERVERS=${PHP_FCGI_START_SERVERS:-2}"
- "PHP_FCGI_SPARE_SERVERS=${PHP_FCGI_SPARE_SERVERS:-1}"
- "PHP_FCGI_MAX_REQUESTS=${PHP_FCGI_MAX_REQUESTS:-0}"
# Additional PHP settings
- "PHP_SESSION_TIMEOUT=${PHP_SESSION_TIMEOUT:-60}"
- "PHP_SESSION_COOKIE_TIMEOUT=${PHP_SESSION_COOKIE_TIMEOUT:-10080}"
Expand Down
11 changes: 5 additions & 6 deletions template.env
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ SYNCSERVERS_1_PULL_RULES=
# FASTCGI_READ_TIMEOUT=300s
# FASTCGI_SEND_TIMEOUT=300s
# FASTCGI_CONNECT_TIMEOUT=300s
# Whete to listen to PHP-FPM status. Can be a port or a ip:port. If not set the status page will not be shown.
# Where to listen to PHP-FPM status. Can be a port or a ip:port. If not set the status page will not be shown.
# Do not expose this page in public networks.
# FASTCGI_STATUS_LISTEN=""

Expand All @@ -203,14 +203,13 @@ SYNCSERVERS_1_PULL_RULES=

## PHP FPM pool setup
# Maximum number of php-fpm processes, limits the number of simultaneous requests.
PHP_FCGI_CHILDREN="5"
# PHP_FCGI_CHILDREN=5
# Number of processes created on startup.
PHP_FCGI_START_SERVERS="2"
# PHP_FCGI_START_SERVERS=2
# The desired number of idle server processes.
PHP_FCGI_SPARE_SERVERS="1"
# PHP_FCGI_SPARE_SERVERS=1
# The number of requests each process should execute before respawning. "0" means endless request processing.
PHP_FCGI_MAX_REQUESTS="0"

# PHP_FCGI_MAX_REQUESTS=0

## Additional PHP settings
# Timeout (in minutes) for user session inactivity before it expires.
Expand Down

0 comments on commit 9bb03ea

Please sign in to comment.