diff --git a/docker-compose.yml b/docker-compose.yml index 07befe8..9ffa781 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,6 +7,8 @@ services: # build: . # image: fascinated/sharex-php-uploader restart: always + environment: + - MAX_UPLOAD_SIZE=500M ports: - 80:80 volumes: diff --git a/docker/start.sh b/docker/start.sh index 4e55b03..2434eff 100644 --- a/docker/start.sh +++ b/docker/start.sh @@ -11,6 +11,13 @@ echo "Starting PHP" service php8.1-fpm start chmod 777 /run/php/php8.1-fpm.sock # I don't know how to fix this properly, but it works. +echo "Setting max upload size to ${MAX_UPLOAD_SIZE}" +sed -i "s/^upload_max_filesize = .*/upload_max_filesize = ${MAX_UPLOAD_SIZE}/" /etc/php/8.1/fpm/php.ini +sed -i "s/^post_max_size = .*/post_max_size = ${MAX_UPLOAD_SIZE}/" /etc/php/8.1/fpm/php.ini + +# Restart php to apply changes +service php8.1-fpm restart + # Start Nginx echo "Starting Nginx" nginx -g "daemon off;" \ No newline at end of file