You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After re-creating the Docker containers, for example after modifying .wp-env.json, the database is kept, but uploads are not. This surprised me. It is pretty annoying behaviour when working on a plugin that relies on uploaded images, because now the image files are all gone.
What is your proposed solution?
A persistent Docker volume could be mounted on /var/www/html/wp-content/uploads. This would work similarly to /var/lib/mysql in the MySQL container. These two volumes should probably be cleared at the same moments, because an upload without a corresponding database entry is fairly useless, and a database with entries for nonexistent uploads is also fairly useless.
With plain docker-compose, this feature would be trivial to add. I don't know anything about the internals of wp-env but I'm hoping it's similarly easy.
Workaround
Use "mappings" to put uploads in a directory on the host. This is imperfect at best, because they will end up owned by whatever user has ID 33 on the host system (which maps to www-data in the container).
The text was updated successfully, but these errors were encountered:
What problem does this address?
After re-creating the Docker containers, for example after modifying
.wp-env.json
, the database is kept, but uploads are not. This surprised me. It is pretty annoying behaviour when working on a plugin that relies on uploaded images, because now the image files are all gone.What is your proposed solution?
A persistent Docker volume could be mounted on
/var/www/html/wp-content/uploads
. This would work similarly to/var/lib/mysql
in the MySQL container. These two volumes should probably be cleared at the same moments, because an upload without a corresponding database entry is fairly useless, and a database with entries for nonexistent uploads is also fairly useless.With plain
docker-compose
, this feature would be trivial to add. I don't know anything about the internals ofwp-env
but I'm hoping it's similarly easy.Workaround
Use
"mappings"
to put uploads in a directory on the host. This is imperfect at best, because they will end up owned by whatever user has ID 33 on the host system (which maps towww-data
in the container).The text was updated successfully, but these errors were encountered: