Merge pull request #3560 from alchemy-fr/PHRAS-3167_add_fpm_parameters

PHRAS-3167 merge add env for set the php and the nginx gateway timeout
This commit is contained in:
Nicolas Maillat
2020-07-06 23:21:51 +02:00
committed by GitHub
5 changed files with 12 additions and 3 deletions

5
.env
View File

@@ -13,6 +13,8 @@ RABBITMQ_MANAGEMENT_PORT=10811
MYSQL_ROOT_PASSWORD=root
SERVER_NAME=phraseanet-docker
# --------------- GATEWAY TIMEOUT -----------------------
GATEWAY_SEND_TIMEOUT=120
# --------------- PHP CONFIGURATION --------------------
@@ -21,6 +23,9 @@ MAX_BODY_SIZE=2G
# Max input var
MAX_INPUT_VARS=12000
MAX_EXECUTION_TIME=120
MAX_INPUT_TIME=60
# Enable opcache ? (0/1)
OPCACHE_ENABLED=1
# session cache limiter (off/on)

View File

@@ -19,6 +19,7 @@ services:
- phraseanet
environment:
- MAX_BODY_SIZE
- GATEWAY_SEND_TIMEOUT
ports:
- ${PHRASEANET_APP_PORT}:80
@@ -40,6 +41,8 @@ services:
- PHRASEANET_PROJECT_NAME
- MAX_BODY_SIZE
- MAX_INPUT_VARS
- MAX_EXECUTION_TIME
- MAX_INPUT_TIME
- OPCACHE_ENABLED
- SESSION_CACHE_LIMITER
- PHP_LOG_LEVEL

View File

@@ -2,6 +2,6 @@
set -xe
cat /nginx.conf.sample | sed "s/\$MAX_BODY_SIZE/$MAX_BODY_SIZE/g" > /etc/nginx/conf.d/default.conf
cat /nginx.conf.sample | sed "s/\$MAX_BODY_SIZE/$MAX_BODY_SIZE/g" | sed "s/\$GATEWAY_SEND_TIMEOUT/$GATEWAY_SEND_TIMEOUT/g" > /etc/nginx/conf.d/default.conf
exec "$@"

View File

@@ -1,3 +1,4 @@
send_timeout $GATEWAY_SEND_TIMEOUT;
upstream backend {
server phraseanet:9000;
}

View File

@@ -380,7 +380,7 @@ expose_php = On
; Maximum execution time of each script, in seconds
; http://php.net/max-execution-time
; Note: This directive is hardcoded to 0 for the CLI SAPI
max_execution_time = 9999
max_execution_time = $MAX_EXECUTION_TIME
; Maximum amount of time each script may spend parsing request data. It's a good
; idea to limit this time on productions servers in order to eliminate unexpectedly
@@ -390,7 +390,7 @@ max_execution_time = 9999
; Development Value: 60 (60 seconds)
; Production Value: 60 (60 seconds)
; http://php.net/max-input-time
max_input_time = 60
max_input_time = $MAX_INPUT_TIME
; Maximum input variable nesting level
; http://php.net/max-input-nesting-level