how do I reuse volumes from another docker-compose file?


Hi! I have a docker-compose with a wordpress and a db cointainer in them with volumes defined like this: "db:/var/lib/mysql" and "wordpress:/var/www/html" in a folder called "website" so the volumes are now named "website_db" and "website_wordpress".

I want to move the compose content to another location merged with a larger compose file.

When I spin it up, docker seems to recreate new volumes based on the folder name of the new docker-compose-yml location.

Question: How do I make the containers use the existing volumes instead?

submitted by /u/WickedViking
[link] [comments]
Source: Reddit