Reputation: 3484
I have a web application running in container.
The application allows users to upload files. These files are stored in Docker volumes web_data1
and web_data2
.
Due to changes in the application, I need to change the mountpoint of these volumes i.e.
the data that were in /srv/app/web_data1_mountpoint
, now need to be moved to /srv/app/web_data1_changed_mountpoint
.
What is the proper way to do this?
docker-compose.yml
version: "3"
volumes:
web_data1:
web_data2:
services:
web:
build:
context: .
dockerfile: .docker/Dockerfile
image: web-image
ports:
- 80:80
- 443:443
volumes:
- web_data1:/srv/app/web_data1_mountpoint
- web_data2:/srv/app/web_data2_mountpoint
Upvotes: 2
Views: 4272
Reputation: 285
That depends a bit of the image you are using. Just changing the volume would work in your docker-compose.yml like this:
volumes:
- web_data1:/srv/app/web_data1_changed_mountpoint
- web_data2:/srv/app/web_data2_changed_mountpoint
But I dont know, what your image does with the directory. Maybe something inside the image depends on the directory.
Upvotes: 4