walle 2.0 安装教程 docker 方式

 

1.安装docker 

https://docs.docker.com/compose/install/

2.安装 docker-compose

walle使用的 需要docker-compose 18.06.0+的版本

https://docs.docker.com/compose/install/

问题:

解决:

sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

3.下载walle

链接:https://pan.baidu.com/s/1By90YYNJQXCb6y9UR3wJRA 
提取码:aome 

上传到服务器

目录:/opt/app

解压:unzip walle-web-master 

执行 mv walle-web-master walle-web  cd walle-web

4.vim docker-compose.yml

version: '3.7'
services:
  web:
    image: alenx/walle-web:2.0
    container_name: walle-nginx
    hostname: nginx-web
    ports:
    # 如果宿主机80端口被占用,可自行修改为其他port(>=1024)
    # 0.0.0.0:要绑定的宿主机端口:docker容器内端口80
      - "80:80"
    links:
      - python
    depends_on:
      - python
    networks:
      - walle-net
    restart: always

  python:
    # 默认使用alenx/walle-python:2.0
    # maven工程使用alenx/walle-java:2.0; maven:3.6.0, jdk:1.8.0_181
    image: alenx/walle-python:2.0
#    image: alenx/walle-java:2.0
    container_name: walle-python
    hostname: walle-python
    volumes:
      - /tmp/walle/codebase/:/tmp/walle/codebase/
      - /tmp/walle/logs/:/opt/walle-web/logs/
      - /root/.ssh:/root/.ssh/
    command: bash -c "cd /opt/walle-web/ && /bin/bash admin.sh migration && python waller.py"
    expose:
      - "5000"
    links: 
      - db
    depends_on:
      - db
    networks:
      - walle-net
    restart: always

  db:
    image: mysql
    container_name: walle-mysql
    hostname: walle-mysql
    ports:
      - "3306:3306"
    expose:
      - "3306"
    command: --default-authentication-plugin=mysql_native_password
    environment:
      MYSQL_ROOT_PASSWORD: walle
      MYSQL_DATABASE: walle
    volumes:
      - /data/walle/mysql:/var/lib/mysql
    networks:
      - walle-net
    restart: always

networks:
  walle-net:
    driver: bridge

4.一键启动(快速体验)

docker-compose up -d && docker-compose logs -f

walle 2.0 安装教程 docker 方式_第1张图片

当你看到这个日志的时候,表示安装成功

常用操作

# 构建服务
docker-compose build
# 启动服务,启动过程中可以直接查看终端日志,观察启动是否成功
docker-compsoe up
# 启动服务在后台,如果确认部署成功,则可以使用此命令,将应用跑在后台,作用类似 nohup python waller.py &
docker-compose up -d
# 查看日志,效果类似 tail -f waller.log
docker-compose logs -f
# 停止服务,会停止服务的运行,但是不会删除服务所所依附的网络,以及存储等
docker-compsoe stop
# 删除服务,并删除服务产生的网络,存储等,并且会关闭服务的守护
docker-compose down

 

5.开启walle 2.0之旅

恭喜你,大功告成!浏览器打开http://127.0.0.1:80(宿主机上)。初始登录账号如下,开启你的walle 2.0之旅吧:)

超管:[email protected] \ Walle123
所有者:[email protected] \ Walle123
负责人:[email protected] \ Walle123
开发者:[email protected] \ Walle123
访客:[email protected] \ Walle123

 

 

你可能感兴趣的:(运维)