snipe-it
snipe-it copied to clipboard
docker version picture upload size limited
Debug mode
- [X] I have enabled debug mode
- [X] I have read checked the Common Issues page
Describe the bug
I using this fantastic application within a docker container behind a NGINX reverse proxy. I can't upload product pictures bigger then 2MB. How can I mange this problem? The NGINX reverse proxy allow upload size 5 GB
Reproduction steps
- Login
- Create a new asset
- Upload a 5 MB product picture
Expected behavior
docker environment variable to set max upload size
Screenshots
No response
Snipe-IT Version
5.4.1
Operating System
Centos 9 Stream
Web Server
NGINX
PHP Version
official docker container
Please add a env variable witch setup the php config upload_max_filesize
and post_max_size
inside the /etc/php7/php.ini
file. I think this can be done with the entrypoint.
We would be happy to take a Pull Request that implements this feature.
@uberbrady Isn't there already a variable that controls the upload_max_filesize in the php.ini?
# Fix php settings
if [ -v "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/*/apache2/php.ini
fi
From https://github.com/snipe/snipe-it/blob/master/docker/startup.sh
Is the -v flag even correct in this case? I'm no shell script writer but looking for the -v flag returns nothing. Should it not be -n?
GitHub
A free open source IT asset/license management system - snipe-it/startup.sh at master · snipe/snipe-it
Without also changing the post_max_size
variable inside the php.ini to the same or bigger value it doesn't work see https://www.php.net/manual/de/ini.core.php#ini.upload-max-filesize
-v
is used to mount a directory to the container -e
is for passing variables
Try docker run -e PHP_UPLOAD_LIMIT=8M ... snipe/snipe-it
Try
docker run -e PHP_UPLOAD_LIMIT=8M ... snipe/snipe-it
That was working for me! Thank you very much!
Anyone using Azure can add PHP_UPLOAD_LIMIT=8 to the application settings