Merge pull request #15115 from r-xyz/alpine-upload-limit

Improved Docker environment settings: implement `PHP_UPLOAD_LIMIT` for Alpine images
This commit is contained in:
snipe 2024-07-18 18:49:00 +01:00 committed by GitHub
commit 94e0739a74
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -39,6 +39,14 @@ chown -R apache:root /var/lib/snipeit/data/*
chown -R apache:root /var/lib/snipeit/dumps chown -R apache:root /var/lib/snipeit/dumps
chown -R apache:root /var/lib/snipeit/keys chown -R apache:root /var/lib/snipeit/keys
# Fix php settings
if [ ! -z "${PHP_UPLOAD_LIMIT}" ]
then
echo "Changing upload limit to ${PHP_UPLOAD_LIMIT}"
sed -i "s/^upload_max_filesize.*/upload_max_filesize = ${PHP_UPLOAD_LIMIT}M/" /etc/php*/php.ini
sed -i "s/^post_max_size.*/post_max_size = ${PHP_UPLOAD_LIMIT}M/" /etc/php*/php.ini
fi
# If the Oauth DB files are not present copy the vendor files over to the db migrations # If the Oauth DB files are not present copy the vendor files over to the db migrations
if [ ! -f "/var/www/html/database/migrations/*create_oauth*" ] if [ ! -f "/var/www/html/database/migrations/*create_oauth*" ]
then then