Python Service in container - keeps running old code from volume

Hi There,

We have multiple python services running in a container and it references other python test scripts from volume. Issue we have is - python services keep using old code from test script files in volume and does not take in the latest changes from the volume.

Service A, Service B - Running inside container.
Volume V - contain the python test script files.

We have to restart container for service to see the latest changes. Any suggestion to solve this?

Note - We are using docker-compose to run multi container application.

Remove your old volume before running the service again.

docker volume ls then docker volume rm some_volume

Then start your service: docker-compose up -d

Does it mean we have to remove the volume each time we have a new version of container?

I tried removing the volume and starting services again. It’s still the same issue.