码迷,mamicode.com
首页 > 其他好文 > 详细

容器编排docker-compose

时间:2019-03-11 11:53:38      阅读:176      评论:0      收藏:0      [点我收藏+]

标签:http   start   latest   yum   some   install   data   doc   .com   

安装:

curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum install -y python2-pip
pip install docker-compose

检查是否安装成功
docker-compose -v

docker-compose.yml文件示例:

vi docker-compose.yml

version: ‘3‘
services:
   db:
     image: mysql:5.7
     volumes:
       - db_data:/var/lib/mysql
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: somewordpress
       MYSQL_DATABASE: wordpress
       MYSQL_USER: wordpress
       MYSQL_PASSWORD: wordpress
   wordpress:
     depends_on:
       - db
     image: wordpress:latest
     volumes:
       - web_data:/var/www/html
     ports:
       - "80"
     restart: always
     environment:
       WORDPRESS_DB_HOST: db:3306
       WORDPRESS_DB_USER: wordpress
       WORDPRESS_DB_PASSWORD: wordpress
volumes:
    db_data:
    web_data:

容器编排docker-compose

标签:http   start   latest   yum   some   install   data   doc   .com   

原文地址:https://blog.51cto.com/12083623/2361084

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