How to make docker container be notified when volume from another container was updated?

100 views Asked by At

I have docker container with Nginx and data container with static (JS,CSS) files only. At app start Nginx mounts volume from data container using volume_from. The problem appears when I want to update my static files because Nginx container can't see that volume has changed. Is it possible to fetch static volume changes without restarting Nginx container?

proxy:
  image: proxy
  volumes_from:
    - static:ro
  ports:
    - "80:80"
  restart: always
  sequential_deployment: true
static:
  image: static
  volumes:
    - /home/node/static/build
  read_only: true
  command: "true"
1

There are 1 answers

0
opHASnoNAME On

I know this problem from VirtualBox.. you could try to add this into your nginx.conf:

sendfile off;

Nginx Docs