docker-compose.yml範例

version: '2'php

services:html

  apache_with_php:mysql

    networks:nginx

      - "blogNet"sql

    build: .apache

    volumes:ui

      - $PWD/uploads:/var/www/html/rest

    expose:  htm

      - 80  blog

  nginx:

    image: "nginx:latest"

    networks:

      - "blogNet"

    volumes:

      - $PWD/logs:/var/log/nginx

      - $PWD/nginx.conf:/etc/nginx/nginx.conf

    ports:

      - "80:80"

    links:  

      - apache_with_php

  mysql:

    environment:

        MYSQL_ROOT_PASSWORD: "86qweqweqwe"

        MYSQL_USER: 'admin'

        MYSQL_PASS: 'admin'

    image: "daocloud.io/library/mysql:8" 

    restart: always

    networks:

        - "blogNet"

    command: 

      --default-authentication-plugin=mysql_native_password

    volumes:

        - "$HOME/mysqldata/data:/var/lib/mysql"

    ports:

        - "3306:3306"

 

networks:

  blogNet:

    driver: bridge

相關文章
相關標籤/搜索