Skip to main content
The 2024 Developer Survey results are live! See the results

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • I dont want to mount the volume to host, i am creating a script that will zip the file to sftp server and then delete the zip file. Commented Jul 16, 2019 at 11:51
  • 1
    Just suggesting the proper way to do things. You may want to do it otherwise but then you may want to think how to get the data back in the container (or in a new container...).
    – xenoid
    Commented Jul 16, 2019 at 12:03
  • @Web Do yourself a favor and follow this advice. Don't let the WordPress data stay in the container. If the container gets removed or has to be rebuilt, all your data is lost. Also, no other container can access it. The same for the database: provide a separate volume which can be persisted across container runs, and access it from both the WordPress container as well as the one that runs the backups.
    – slhck
    Commented Jul 16, 2019 at 13:37
  • @slhck the problem is that i copying custom wordpress theme using dockerfile. when i mount the volume on host, theme file is overrided by empty files from the host, thats why i mounted the volume in container instead of host. and i am creating continous backups so that if i had a problem , i can re run from the backup. Commented Jul 16, 2019 at 13:50
  • 1
    @Web You have to first mount the volume (e.g. ./data to /var/www/html, and then install the theme. The theme then stays persisted on your host (in ./data).
    – slhck
    Commented Jul 16, 2019 at 13:56