码迷,mamicode.com
首页 > 数据库 > 详细

docker-compose yaml mysql和wordpress 一行命令搞定~~~

时间:2019-01-22 14:23:10      阅读:518      评论:0      收藏:0      [点我收藏+]

标签:port   code   docke   etc   html   wordpress   contain   com   volumes   

version: 3.1

services:
  db:
    container_name: db
    image: mysql/mysql-server
    restart: always
    networks:
      - "blogNet"
    environment:
      MYSQL_ROOT_PASSWORD: pwd123456
    volumes:
      - /Docker/mysql/init:/docker-entrypoint-initdb.d
      - /Docker/mysql/config/my.cnf:/etc/mysql/my.cnf
      - /Docker/mysql/data:/var/lib/mysql

  wordpress:
      container_name: blog
      image: wordpress
      restart: always
      ports:
        - 10000:80
      environment:
        WORDPRESS_DB_HOST: db:3306
        WORDPRESS_DB_USER: liudehua
        WORDPRESS_DB_PASSWORD: pwd123
      networks:
        - "blogNet"
      volumes:
        - /Docker/wordpress/html:/var/www/html
      depends_on:
        - db
networks:
  blogNet:
    driver: bridge

docker-compose file

 

docker-compose yaml mysql和wordpress 一行命令搞定~~~

标签:port   code   docke   etc   html   wordpress   contain   com   volumes   

原文地址:https://www.cnblogs.com/yueyue184/p/10303210.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!