1

I've two containers : nginx & angular. The angular container contains the code and is automatically pulled from the registry when there is a new version (with watchtower).

I set up a Shared Volume between angular & nginx to share the code from angular to nginx.

  ### Angular #########################################
  angular:
    image: registry.gitlab.com/***/***:staging
    networks:
      - frontend
      - backend
    volumes:
      - client:/var/www/client

  ### NGINX Server #########################################
  nginx:
    image: registry.gitlab.com/***/***/***:staging
    volumes:
      - client:/var/www/client
    depends_on:
      - angular
    networks:
      - frontend
      - backend

volumes:
  client:
networks:
  backend:
  frontend:

When I build & run for the first time the environment, everything works. The problem is when there is a new version of the client, the image is pulled, the container is re-built and the new code version is inside the angular container, but in the nginx container it still the old code version of the client.

The shared volumes does not let me do what i want because we can not specify who is the host, is it possible to mount a volumes from a container to an other ?

Thanks in advance.

  • Can you make a 3rd party provider export the shared volume and mount it (as clients) on both the client and the server containers? This way both would mount the same volume regardless which one is re-built (or in which order if both are). – Dan Cornilescu Apr 13 at 14:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.