Set sessions to be stored in Redis rather than files

pull/1/head
Stefano Ortolani 2023-05-12 13:42:23 +01:00
parent aceee6d225
commit 808c41483a
1 changed files with 4 additions and 0 deletions

View File

@ -1,5 +1,7 @@
#!/bin/bash
[ -z "$REDIS_FQDN" ] && REDIS_FQDN=redis
term_proc() {
echo "Entrypoint FPM caught SIGTERM signal!"
echo "Killing process $master_pid"
@ -16,6 +18,8 @@ change_php_vars() {
sed -i "s/max_execution_time = .*/max_execution_time = 300/" "$FILE"
sed -i "s/upload_max_filesize = .*/upload_max_filesize = 50M/" "$FILE"
sed -i "s/post_max_size = .*/post_max_size = 50M/" "$FILE"
sed -i "s/session.save_handler = .*/session.save_handler = redis/" "$FILE"
sed -i "s|.*session.save_path = .*|session.save_path = 'tcp://${REDIS_FQDN}:6379'|" "$FILE"
done
}