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

Linux搭建WebStack-Laravel

  • 一、安装docker服务
  • 二、配置webstack
  • 三、安装docker-compose
  • 四、用docker-compose启动webstack
  • 五、访问webstack

一、安装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,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
        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,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
项目搭建(五)Linux搭建WebStack-Laravel_第1张图片

[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
项目搭建(五)Linux搭建WebStack-Laravel_第2张图片

13、访问webstack的后台管理页面
192.168.1.198:8000/admin #端口号默认是8000
项目搭建(五)Linux搭建WebStack-Laravel_第3张图片


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

  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

你可能感兴趣的:(Linux,linux,laravel,docker,webstack)