My issue:
I’m not able to install any wordpress plugins, I get this error Unable to connect to the filesystem. Please confirm your credentials. This seems like a permissions issue, or something to do with the NFS bind. There are no errors.
I’m able to upload media without a problem.
I’m probably just doing something wrong, or I don’t understand how this docker image works. I hope someone can point me in the right direction. Or give me an suggestion on how to run this stack with a persistent volume for wordpress.
My goal:
Running this stack on a docker swarm (raspberry pi’s) with a persistent volume using NFS. So the wordpress container can run on any node in the cluster. Same goes for the mysql container.
Information
Docker-compose.yml
version: '3.2'
services:
db:
image: mariadb
volumes:
- db_data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: somewordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
wordpress:
image: wordpress
depends_on:
- db
volumes:
- wp_content:/var/www/html
ports:
- "80:80"
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_DB_NAME: wordpress
volumes:
db_data:
driver_opts:
type: "nfs"
o: "addr=192.168.1.245,nolock,soft,rw"
device: ":/vol/mysql"
wp_content:
driver_opts:
type: "nfs"
o: "addr=192.168.1.245,nolock,soft,rw"
device: ":/vol/wordpress"
nfs-server export file
/vol *(rw,sync,no_subtree_check,insecure,all_squash,anonuid=0,anongid=0)
File permissions in /vol
drwxrwxrwx 4 root root 4096 Mar 10 14:59 .
drwxr-xr-x 26 root root 4096 Mar 10 10:00 ..
drwxr-xr-x 5 999 999 4096 Mar 10 15:18 mysql
drwxrwxrwx 5 www-data www-data 4096 Mar 10 15:17 wordpress
File permissions in /vol/wordpress
drwxrwxrwx 5 www-data www-data 4096 Mar 10 15:17 .
drwxrwxrwx 4 root root 4096 Mar 10 14:59 ..
-rw-r--r-- 1 www-data www-data 235 Mar 10 15:26 .htaccess
-rw-r--r-- 1 www-data www-data 420 Nov 30 2017 index.php
-rw-r--r-- 1 www-data www-data 19935 Jan 1 20:37 license.txt
-rw-r--r-- 1 www-data www-data 7425 Jan 9 02:56 readme.html
-rw-r--r-- 1 www-data www-data 6919 Jan 12 06:41 wp-activate.php
drwxr-xr-x 9 www-data www-data 4096 Feb 21 22:09 wp-admin
-rw-r--r-- 1 www-data www-data 369 Nov 30 2017 wp-blog-header.php
-rw-r--r-- 1 www-data www-data 2283 Jan 21 01:34 wp-comments-post.php
-rw-r--r-- 1 www-data www-data 3088 Mar 10 15:17 wp-config.php
-rw-r--r-- 1 www-data www-data 2808 Mar 10 15:17 wp-config-sample.php
drwxr-xr-x 5 www-data www-data 4096 Mar 10 15:42 wp-content
-rw-r--r-- 1 www-data www-data 3847 Jan 9 08:37 wp-cron.php
drwxr-xr-x 19 www-data www-data 12288 Feb 21 22:09 wp-includes
-rw-r--r-- 1 www-data www-data 2502 Jan 16 05:29 wp-links-opml.php
-rw-r--r-- 1 www-data www-data 3306 Nov 30 2017 wp-load.php
-rw-r--r-- 1 www-data www-data 38883 Jan 12 06:41 wp-login.php
-rw-r--r-- 1 www-data www-data 8403 Nov 30 2017 wp-mail.php
-rw-r--r-- 1 www-data www-data 17947 Jan 30 11:01 wp-settings.php
-rw-r--r-- 1 www-data www-data 31085 Jan 16 16:51 wp-signup.php
-rw-r--r-- 1 www-data www-data 4764 Nov 30 2017 wp-trackback.php
-rw-r--r-- 1 www-data www-data 3068 Aug 17 2018 xmlrpc.php