[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# setenforce 0
3.Docker部署
命令如下:
开启镜像加速器
自己在阿里云注册账号并找到镜像容器服务,点开控制台,左栏最下有个镜像加速器
命令:[root@localhost ~]# sudo yum install python-pip
出现以下情况报错时:只能说时运不济
原因:证书验证失败
再执行一次pip install --upgrade pip命令,如果运气好可以执行成功,如果运气不好,慢慢解决
[root@localhost ~]# find / -name adapters.py
解决办法:
打开文件adapters.py 如果不知道位置的话可以用命令fing查找
命令:[root@localhost ~]# find / -name adapters.py
[root@localhost ~]# vim /usr/lib/python2.7/site-packages/pip/_vendor/requests/adapters.py
找到大约第369行添加 verify = False 注意空格,然后wq保存退出
然后再次执行
命令:[root@localhost ~]# pip install --upgrade pip
看见Successfully说明成功
4.2Docker-Compase安装
5.配置文件创建
5.3.创建docker-compose.yml
命令:[root@localhost walle]# vim /opt/walle/docker-compose.yml
添加以下内容:
version: "3.7"
services:
web:
image: alenx/walle-web:2.1
container_name: walle-nginx
hostname: nginx-web
ports:
# 如果宿主机80端口被占用,可自行修改为其他port(>=1024)
# 0.0.0.0:要绑定的宿主机端口:docker容器内端口80
- "80:80"
depends_on:
- python
networks:
- walle-net
restart: always
python:
image: alenx/walle-python:2.1
container_name: walle-python
hostname: walle-python
env_file:
# walle.env需和docker-compose在同级目录
- ./walle.env
command: bash -c "cd /opt/walle_home/ && /bin/bash admin.sh migration && python waller.py"
expose:
- "5000"
volumes:
- /opt/walle_home/plugins/:/opt/walle_home/plugins/
- /opt/walle_home/codebase/:/opt/walle_home/codebase/
- /opt/walle_home/logs/:/opt/walle_home/logs/
- /root/.ssh:/root/.ssh/
depends_on:
- db
networks:
- walle-net
restart: always
db:
image: mysql
container_name: walle-mysql
hostname: walle-mysql
env_file:
- ./walle.env
command: [ '--default-authentication-plugin=mysql_native_password', '--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci']
ports:
- "3306:3306"
expose:
- "3306"
volumes:
- /data/walle/mysql:/var/lib/mysql
networks:
- walle-net
restart: always
networks:
walle-net:
driver: bridge
# 打开浏览器http://ip:80