最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Update Docker volume when image is updated - Stack Overflow

programmeradmin1浏览0评论

I'm running a Wordpress site in a PHP fpm container with NGINX running in it's own container with the following (watered down) docker-compose file:

volumes:
  wp:
    driver: local

services:
  nginx:
    image: nginx:latest
    restart: unless-stopped
    depends_on:
      - bedrock
    volumes:
      - wp:/var/www/html/
      - ./uploads:/var/www/html/web/app/uploads
      - ./vhost.conf:/etc/nginx/conf.d/default.conf
    expose: 
      - 80

  bedrock:
    image: my-site:latest
    restart: unless-stopped
    volumes:
      - ./uploads:/var/www/html/web/app/uploads
      - ./.env:/var/www/html/.env
      - ./php.ini:/usr/local/etc/php/conf.d/php.ini
      - wp:/var/www/html/
    labels:
      - "com.centurylinklabs.watchtower.enable=true"

I use the wp volume so NGINX can serve the files from the bedrock container, but whenever I make an update in the code of the bedrock site and update the image, I nee to manually remove the volume and restart it. Is there a way the NGINX container can serve the files from the bedrock container without needing to remove the volume?

发布评论

评论列表(0)

  1. 暂无评论