Support » Installing WordPress » Docker install: volumes and upgrade

  • I’m using docker-compose to install wordpress. I see different approaches:
    – the official documentation doesn’t create any volume at all so an update of wordpress will just delete your wp_content data
    – creating a volume with /var/www/html/wp_content (and the database) which I understand being the right way as all changes are there and when updating wordpress by pulling the new images, everything else will be properly replaced with the new version
    – creating a volume with /var/www/html in which case updating the docker image to the latest version will not update the wordpress files themselves. So I have the impression this isn’t the right approach, or you should not update the image but update wordpress from it’s built-in admin interface, I’m not sure.

    I’m surprised to see so many examples using the third approach but also that adding wp-cli needs to share the whole wordpress volume with the cli container so in that case only the third approach could work for wp-cli but the second approach looks to be the right one to me. I’m probably missing something, could someone help clarify?


Viewing 2 replies - 1 through 2 (of 2 total)
  • I’m not sure what you mean.
    It’s okay to not update the wp-content directory, but really you should be renaming the old container, and pulling a new one.
    You can also manage everything you need using wp-cli, it rocks.

    Thread Starter jaguarondi


    Are you sharing the whole wordpress (mapped to /var/www/html) volume between your wordpress and wp-cli containers? If so, how do you manage updates with docker?


Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Docker install: volumes and upgrade’ is closed to new replies.