从docker-compose v2迁移到v3


3

我在迁移到docker-compose v3时遇到了一些问题。目前,我有php-fpm的nginx容器,它们共享相同的卷。我的设置看起来像这样

nginx:
    build:
        context: ./nginx
    depends_on: 
        - php-fpm
        - mariadb
    volumes_from: 
        - php-fpm
    ports:
        - "80:80"
        - "443:443"
    networks: 
        - lemp-network

php-fpm:
    build:
        context: ./php-fpm       
    volumes: 
        - ..:/var/www/hosts
        - ./logs/nginx/:/var/log/nginx
    networks:
        - lemp-network

如果必须使用这两个容器创建共享卷,如何在版本3中执行此操作?

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.