Answer the question
In order to leave comments, you need to log in
How to update contents of mounted volume in docker service?
Good afternoon!
There is a docker-compose.yml file:
version: "3.5"
services:
nginx:
image: nginx:latest
depends_on:
- my-app
- my-admin
ports:
- 80:80
volumes:
- /home/project/data/nginx/conf.d:/etc/nginx/conf.d
- /home/project/public:/var/public
- my-admin-volume:/usr/src/app
networks:
- my-network
deploy:
placement:
constraints: [node.role == manager]
my-admin:
image: my-admin
env_file:
- /home/project/ucell.env
ports:
- 9000:9000
depends_on:
- mariadb
- redis
- mongodb
working_dir: /usr/src/app
volumes:
- /home/project/data/log:/var/log/container
- /home/project/public:/usr/src/app/storage/app/public
- my-admin-volume:/usr/src/app
networks:
- my-network
volumes:
my-admin-volume:
networks:
my-network:
docker stack deploy -c docker-compose.yml prod
docker service update --image my-admin:v2 prod_my-admin --force
(v2 here for example). docker service update --mount-add type=volume,source=prod_my-admin-volume,target=/usr/src/app prod_my-admin
docker service update --mount-add type=volume,source=prod_my-admin-volume,target=/usr/src/app prod_nginx
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