最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

Update Docker volume when image is updated - Stack Overflow

matteradmin5PV0评论

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?

Post a comment

comment list (0)

  1. No comments so far