项目搭建(五)Linux搭建WebStack-Laravel

一、安装docker服务

1、yum执行docker安装命令

yum install docker-io -y

2、完成安装后,查看是否安装成功
docker --version

[root@lsxxxxxxQ ~]# docker --version
Docker version 20.10.17, build 100c701

3、启动docker

systemctl start docker

4、设置docker开机自启动

systemctl enable docker

5、启动docker后,会新增一个网卡,查看新增的docker网卡

ifconfig
[root@lxxxxxxxQ webstack_etc]# ifconfig
br-0e5814797a8f: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 111.11.0.1  netmask 255.255.0.0  broadcast 111.11.255.255
        inet6 fe80::42:9ff:feda:e418  prefixlen 64  scopeid 0x20<link>
        ether 01:41:01:da:e1:11  txqueuelen 0  (Ethernet)
        RX packets 11733900  bytes 4344606035 (4.0 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 12783653  bytes 3983865718 (3.7 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 111.11.0.1  netmask 255.255.0.0  broadcast 111.11.255.255
        ether 01:41:d5:1d:22:c1  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

二、配置webstack

6、创建操作的根目录

mkdir /root/webstack

7、进入创建好的根目录,上传启动配置
配置下载地址:webstack_etc
在这里插入图片描述

[root@lsxxxxxxxwQ ~]# cd /root/webstack/
[root@lsxxxxxxxwQ webstack]# ll
total 12
drwxr-xr-x 2 root root 4096 Aug 25 14:04 webstack_etc
-rw-r--r-- 1 root root 2211 Aug 22 10:35 webstack_etc.zip

三、安装docker-compose

8、先用yum安装pip3

yum install python3-pip

9、再用pip3安装docker-compose

pip3 install docker-compose

四、用docker-compose启动webstack

10、进入webstack配置文件目录/root/webstack/webstack_etc,使用docker-compose,启动webstack
(启动webstack网站,首次启动需要从docker hub中下载到本地,会有些慢)

cd /root/webstack/webstack_etc
docker-compose up -d

11、检查是容器否启动
#查看docker下所有的镜像docker images

[root@lsxxxxxxwQ webstack_etc]# docker images
REPOSITORY                   TAG       IMAGE ID       CREATED         SIZE
arvon2014/webstack-laravel   v1.2.2    3826aa52f020   11 months ago   181MB
mysql/mysql-server           5.6       8c587c89edee   20 months ago   238MB
redis                        3         87856cc39862   3 years ago     76MB

#查看一下容器是否启动docker ps

[root@lxxxxxxxwQ webstack_etc]# docker ps
CONTAINER ID   IMAGE                               COMMAND                  CREATED       STATUS                  PORTS                                       NAMES
18c9494183f6   arvon2014/webstack-laravel:v1.2.2   "/sbin/tini -- /entr…"   4 weeks ago   Up 4 weeks              0.0.0.0:8000->8000/tcp, :::8000->8000/tcp   wsl
0e1a9d6aa3bb   redis:3                             "docker-entrypoint.s…"   4 weeks ago   Up 4 weeks              6379/tcp                                    redis_wsl
019f7bbf30bf   mysql/mysql-server:5.6              "/entrypoint.sh --de…"   4 weeks ago   Up 11 hours (healthy)   3306/tcp                                    mysql_wsl

五、访问webstack

12、访问webstack这个网站
#webstack首页
192.168.1.198:8000 #端口号默认是8000
在这里插入图片描述

13、访问webstack的后台管理页面
192.168.1.198:8000/admin #端口号默认是8000
在这里插入图片描述


我的报错解决记录(仅用于自己查看)

  370  root 2022/08/22 14:33:23 cd PyNaCl-1.4.0/
  371  root 2022/08/22 14:33:23 ll
  374  root 2022/08/22 14:33:53 make
  375  root 2022/08/22 14:33:58 make install
  376  root 2022/08/22 14:34:47 python3 setup.py build
  377  root 2022/08/22 14:50:04 yum -y install python3-devel
  378  root 2022/08/22 14:50:32 history
  379  root 2022/08/22 14:50:52 pip3 install pynacl
  382  root 2022/08/22 15:06:06 fully installed pynacl-1.5.0
  383  root 2022/08/22 15:31:18 docker-compose
  385  root 2022/08/22 15:32:00 pip3 install docker-compose
  386  root 2022/08/22 15:32:14 ll
  387  root 2022/08/22 15:32:16 cd ../..
  390  root 2022/08/22 15:32:21 ll
  391  root 2022/08/22 15:32:23 cd webstack_etc/
  392  root 2022/08/22 15:32:24 ll
  393  root 2022/08/22 15:33:19 docker-compose up -d
  395  root 2022/08/22 15:40:00 docker images
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值