问答详情
源自:6-3 compose实战

docker-compose.yml

version: '2'

networks:

 - ghost

services:

 ghost-app:

   build: ghost

   networks:

     - ghost

   depends_on:

     - db

   ports:

     - "2368:2368"


  nginx:

    build: nginx

    networks:

      - ghost

    depends_on:

      - ghost-app

    ports:

      - "80:80"


  db:

    image: "mysql:5.7.15"

    networks:

      - ghost

    environment:

      MYSQL_ROOT_PASSWORD: mysqlroot

      MYSQL_USER: ghost

      MYSQL_PASSWORD: ghost

    volumes:

      - $PWD/data:/var/libmysql

    ports:

      - "3306:3306"


提问者:小刘呀 2022-02-10 11:44

个回答

  • 山青媛娴
    2022-03-09 11:16:36

    老师不是说后面

      ghost:

          - $PWD/data:/var/lib/mysql

    这两处改了么