Skip to content
Advertisement

Docker Compose: Set variable in php.ini from Dockerfile

I have a small Docker network based on this package for Docker Compose and Laravel. I’d like to set the upload_max_filesize and post_max_size variables in php.ini to allow for larger file uploads.

Is this possible? Or is there an alternative approach? I expected to find lots of similar questions on the web, but it’s not that many and typically they concern some existing image, while I create the PHP image from a Dockerfile.

This is from docker-compose.yml:

JavaScript

This is php.dockerfile

JavaScript

Advertisement

Answer

You can create your own php.ini locally and COPY it in your dockerfile for instance.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement