Answer the question
In order to leave comments, you need to log in
How to update the contents of the docker volume when updating the project and is it correct to attach folders with code files to the volume?
I have a Flask + Gunicorn app, it's in a docker container. There is Nginx, which is also in a separate container. Requires Nginx to serve static files, including the js file, which are located in the static folder. Accordingly, for this, two containers must have a common volume.
When I just create volume and run containers, there are no problems, all actual js files end up in volume. However, if you update the container image and then restart, the js files remain unchanged.
The problem is not related to Ngnix, as I haven't selected the option to serve static files yet, only normal requests.
I now solve this problem like this:
1. I stop and delete the container that uses volume docker rm -f
2. I delete volumedocker volume rm flask_static_files_volume_name
3. I create volume again
docker volume create flask_static_files_volume_name
docker run -v ... appname_container_image
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question