zoukankan      html  css  js  c++  java
  • 系统综合实践 第3次实践作业

    一.安装docker-compose
    1.下载docke-compose

    2.添加可执行权限

    3.测试安装结果

    二.拉取相关镜像
    1.mysql

    2.php

    3.nginx

    三.编写dockerfile(创建docker_compose文件夹,并建立web文件夹作为nginx,php的工作目录和挂载容器卷的目录,建立mysql_data作为mysql挂载容器卷的目录)
    1.dockerfile_mysql

    2.dockerfile_php

    3.dockerfile_nginx

    4.default.conf

    5.docker-compose.yml

    6.在web目录中建立index.html文件,index.php文件

    四.使用compose实现多容器运行机制
    1.查看docker_compose的树状结构

    2.执行docker-compose

    3.查看镜像

    4.查看容器

    5.访问localhost/index.html

    6.访问localhost/index.php

    五.服务测试
    1.检测PHP是否能够成功连接Mysql数据库
    (1)修改index.php文件

    (2)访问ocalhost/index.php

    2.在index.php文件中创建数据库
    (1)修改index.php文件

    (2)访问ocalhost/index.php

    (3)进入mysql容器,进入数据库并查询数据库

    3.在数据库中创建数据表
    (1)创建user数据表

    (2)访问http://localhost/index.php

    (3)在mysql容器中,选中数据库并查询数据表

    4.向user数据表中插入数据
    (1)插入数据

    (2)访问http://localhost/index.php

    (3)在数据库中查询

    5.修改user数据
    (1)修改数据

    (2)访问http://localhost/index.php

    (3)在数据库中查询记录是否被修改

    6.删除表中数据
    (1)删除数据

    (2)访问http://localhost/index.php

    (3)在数据库中查询记录是否被删除

    六。增加phpmyadmin容器,实现web端的数据库管理
    1.在docker-compose.yml文件中增加以下代码

    2.在docker_compose文件夹中创建并编写docker_phpmyadmin文件

    3.访问localhost:8080/index.php

  • 相关阅读:
    递增三元子序列
    Linux sed 命令
    linux shell中$0,$?,$!等的特殊用法
    ansible-playbook使用
    Linux下通过crontab命令来实现定时任务
    iperf网络性能测试
    OpenStack接口测试工具rally/tempest环境搭建及使用
    Jenkins配置slaver节点
    微信小程序跳转外部链接(h5页面)以及数据交互
    Echarts 系列之折线图、柱状图相关配置
  • 原文地址:https://www.cnblogs.com/silentstone/p/12845410.html
Copyright © 2011-2022 走看看