Docker Wordpress plugins persistence or mapping to local plugins Docker Wordpress plugins persistence or mapping to local plugins wordpress wordpress

Docker Wordpress plugins persistence or mapping to local plugins


Yes, there is a way. You firstly need to rearrange directorys structure.On your host machine, your using themes directory for mount point. Lets say your going to do it like this. Make new directory on your host machine, and call it wp-content. Now you can edit just this line in your docker-compose file which needs to be moved inside of this wp-content directory.

   volumes:       - .:/var/www/html/wp-content/  

Put your theme in wp-content/themes. It should be exactly as if it where on server.Note: All the other wp default directory structure would be recreated on that mount point, and it will be persistent.

Edit: After chatting a bit, I understood what OP needed. In order to mount another dir from this architecture. You will need to point to the right path and mount it like this:

volumes:  - .:/var/www/html/wp-content/themes/testing:delegated  - ./plugins:/var/www/html/wp-content/plugins