docker-compose (单机版的容器编排工具)
类似于ansible剧本 yml 格式
要使用这个编排工具,必须先安装
yum install -y docker-compose
cd wordpress/ vi docker-compose.yml ############### version: '3' services: db: image: mysql:5.7 volumes: - /data/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: - /data/web_data:/var/www/html ports: - "80:80" restart: always environment: WORDPRESS_DB_HOST: db WORDPRESS_DB_USER: wordpress WORDPRESS_DB_PASSWORD: wordpress ############### 在含有docker-compose.yml的目录下执行 docker-compose up -d 访问网页,检查
使用docker-compose编排方式,安装zabbix
vim docker-compose.yml ################ version: '3' services: mysql-server: image: mysql:5.7 restart: always command: --character-set-server=utf8 --collation-server=utf8_bin environment: MYSQL_ROOT_PASSWORD: root_pwd MYSQL_DATABASE: zabbix MYSQL_USER: zabbix MYSQL_PASSWORD: zabbix_pwd zabbix-java-gateway: image: zabbix/zabbix-java-gateway:latest restart: always zabbix-server: depends_on: - mysql-server - zabbix-java-gateway image: zabbix/zabbix-server-mysql:latest ports: - "10051:10051" restart: always environment: DB_SERVER_HOST: mysql-server MYSQL_DATABASE: zabbix MYSQL_USER: zabbix MYSQL_PASSWORD: zabbix_pwd MYSQL_ROOT_PASSWORD: root_pwd ZBX_JAVAGATEWAY: zabbix-java-gateway zabbix-web: depends_on: - mysql-server - zabbix-server image: zabbix/zabbix-web-nginx-mysql:latest ports: - "80:80" restart: always environment: DB_SERVER_HOST: mysql-server MYSQL_DATABASE: zabbix MYSQL_USER: zabbix MYSQL_PASSWORD: zabbix_pwd MYSQL_ROOT_PASSWORD: root_pwd ################ 在含有docker-compose.yml的目录下执行 docker-compose up -d 访问网页,检查
相关推荐
Wordpress0 2020-09-27
bluehost 2020-09-15
maccarty 2020-08-03
86520993 2020-07-28
WordPress 2020-07-04
李维山 2020-06-21
GimmeS 2020-06-14
WordPress 2020-06-10
shayuchaor 2020-06-10
liwf 2020-06-02
疯狂老司机 2020-05-26
zcl 2020-05-12
timewind 2020-05-11
86520993 2020-05-04
Lophole 2020-04-29
fraternityjava 2020-04-23
84911835 2020-04-16
maccarty 2020-04-09
WordPress 2020-04-07