2 posts tagged

wordpress

A) Add the following 2 lines to your wordpress Dockerfile:

RUN touch /usr/local/etc/php/conf.d/uploads.ini \
    && echo "upload_max_filesize = 10M;" >> /usr/local/etc/php/conf.d/uploads.ini

However, on the docker registry page they recommend adding a custom php.ini to /usr/local/lib.

B) Set the limits with your .htaccess file thats in your wordpress data directory.
In my case I have this directory under version control anyways, as would most.
The bottom 2 lines are what I added to my .htaccess on a brand new wordpress install via docker:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

php_value post_max_size 24M
php_value upload_max_filesize 8M
dockerwordpress

Проще пареной репы

wordpress:
  image: wordpress
  links:
    - db:mysql
  ports:
    - 8080:80

db:
  image: mysql:5
  environment:
    MYSQL_ROOT_PASSWORD: example

только затем лучше руками пофиксить лимиты

docker exec -it XXX bash
printf "\nphp_value post_max_size 64M\nphp_value upload_max_filesize 64M\n" >> .htaccess

перестартуем контейнеры и вуаля!

dockerwordpress