Asset upload size config - Docker


#1

@Sebastian , good evening!

I have a question, like changing the file size limit to upload in docker.


#2

Good morning. What is your question? :wink:


#3

In general you can overwrite all app settings (https://github.com/Squidex/squidex/blob/master/src/Squidex/appsettings.json) in Docker with environment variables.

All settings get converted to a map of key and value, where the key is the full path to the value.

e.g.

assets:maxSize=123

if you want to override this you just have to use double underscore in your environment variable instead of colon:

ASSETS__MAXSIZE=123


#4

Good Morning,
After you make the change, do I need to do anything else?


#5

Restart of course. What is the problem?


#6

Restart the container or composer?


#7

On this question, I found the answer, just run the following code …

docker-compose up --detach --build

I changed the folder amazenametos to the Azure Blob - ok

ASSETSTORE__TYPE=AzureBlob
ASSETSTORE__AZUREBLOB__CONNECTIONSTRING=…

I’ve alter the upload to

  - ASSETS__MAXSIZE=104857600

But even alerting the size of the upload, I still get the message …

png

png

Being that the file that I am uploading has 3.78 MB, which in theory is still within the standard size that is 5 MB

png


#8

This is an nginx error. I will have a look what you have to configure there and ensure that the setup process is smoother.


#9

The default docker config uses nginx with some default settings and the default option for nginx is 1MB upload size.

You can change it with client_max_body_size 1g for example.

I created an own dockerfile for the proxy where I overwrite a settings: https://github.com/Squidex/squidex-docker/blob/master/standalone/proxy/Dockerfile

You could do the same and overwrite this setting. It would be great if we could make this dockerfile configurable with environment variable and then using a single variable in the .env file to overwrite the setting from nginx and Squidex.

Some help would be very welcome :slight_smile: