admin管理员组

文章数量:1025227

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?

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?

本文标签: Update Docker volume when image is updatedStack Overflow