docker-compose yaml mysql和wordpress 一行命令搞定~~~
Posted Red Cat
拿梦想做
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了docker-compose yaml mysql和wordpress 一行命令搞定~~~相关的知识,希望对你有一定的参考价值。
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 一行命令搞定~~~的主要内容,如果未能解决你的问题,请参考以下文章
docker-compose 中的 MySQL -- 访问被拒绝