docker-joomla
docker-joomla copied to clipboard
Increase php limits
The basic php settings are set for max upload 2mb. In these days you need to increase this to 10mb.
We should add a custom php.ini file
Just for reference, when I first built these images they were heavily based on https://github.com/docker-library/wordpress so there's a lot that isn't necessarily optimal. And I don't have a working Docker installation at the moment so it's harder for me to test changes right now.
That said though, improvements are most definitely welcome.
See https://github.com/docker-library/wordpress/issues/10
For my deployments, in the docker-compose.yml file I include this to allow for my own settings:
joomla-nginx:
image: nginx:alpine
volumes:
- "./nginx/conf.d:/etc/nginx/conf.d"
and...
joomla-php-fpm:
image: joomla:php8.0-fpm-alpine
volumes:
- "./php-fpm/conf.d/joomlaphpoverides.ini:/usr/local/etc/php/conf.d/joomlaphpoverides.ini"
Inside the files I setup the overrides I wish to use:
/nginx/conf.d/settings.conf
client_max_body_size 160m;
/php-fpm/conf.d/joomlaphpoverides.ini
memory_limit = 160M
post_max_size = 160M
upload_max_filesize = 160M
upload_tmp_dir = "/var/www/html/tmp"
log_errors = On
error_log = /var/log/nginx/error.log
Restart your containers when making changes and you should get the limit issue resolved.
NOTE: If you run this behind a reverse proxy, you may need to increase the limits on it as well.
Hope that helps.
are there news to this topic? is there no way maybe in environment section of the compose yml? or something like that? maybe a linked volume to edit php.ini to get those settings running
thanks
I think we can look at this, and increase the defaults... just waiting for J4.2.2 and then we can make the needed changes.
Hello!?
How to deploy like you mention with nginx and php? in portainer Currently i have this:
======================================================= version: '3.1'
services: joomla: image: joomla restart: always links: - joomladb:mysql ports: - 8080:80 environment: JOOMLA_DB_HOST: joomladb JOOMLA_DB_PASSWORD: example
joomladb: image: yobasystems/alpine-mariadb:latest restart: unless-stopped environment: MYSQL_ROOT_PASSWORD: example
(but this gives error in Joomla Inforamtion: Warnings : The PHP temporary folder is not set. WarningSmall PHP maximum POST size. WarningMaximum PHP file upload size is too small.)
you can easy override PHP limits, by mounting a php.ini
file. Here is a docker compose (snippet) example:
joomla_test:
image: joomla:4.2
container_name: joomla_test
restart: unless-stopped
environment:
- APACHE_RUN_USER=#1000
- APACHE_RUN_GROUP=#1000
- JOOMLA_DB_HOST=mariadb_test:3306
- JOOMLA_DB_NAME=${VDM_TEST_DB}
- JOOMLA_DB_USER=${VDM_TEST_DB_USER}
- JOOMLA_DB_PASSWORD=${VDM_TEST_DB_PASS}
depends_on:
- mariadb_test
volumes:
- "${VDM_PROJECT_PATH}/test/joomla:/var/www/html"
- "${VDM_PROJECT_PATH}/test/php.ini:/var/www/html/php.ini"
# - "${VDM_PROJECT_PATH}/test/docker-entrypoint.sh:/entrypoint.sh" # to override the entry point
networks:
- traefik
labels:
# joomla
- "traefik.enable=true"
- "traefik.http.routers.joomla_test.rule=Host(`test.joomla.local`)"
Doing this should allow enough customization options. Let me know if you have any further questions.