version: '3' services: db: image: mariadb volumes: - ./images/mariadb:/var/lib/mysql:rw restart: always environment: MYSQL_ROOT_PASSWORD: chevereto_root MYSQL_DATABASE: chevereto MYSQL_USER: chevereto MYSQL_PASSWORD: chevereto chevereto: depends_on: - db image: nmtan/chevereto restart: always environment: CHEVERETO_DB_HOST: db CHEVERETO_DB_USERNAME: chevereto CHEVERETO_DB_PASSWORD: chevereto9527@! CHEVERETO_DB_NAME: chevereto CHEVERETO_DB_PREFIX: chv_ VIRTUAL_HOST: example.test.com volumes: - ./images/cheverto:/var/www/html/images:rw #需要给这个images 777权限,如果还是不行需要到容器内( docker exec -ti 容器id bash)给images文件777权限 networks: default: external: name: nginx-proxy