1.1 docker-compose部署


洞察2 一键启动简介

采用docker-compose 启动mysql,redis,服务

(1) 使用Docker Compose

git clone https://github.com/creditease-sec/insight2_docker.git
cd insight2_docker
sudo docker-compose up

(2) 系统登录

地址:http://localhost:8000
帐号:admin
密码:admin!Aa2020
后台地址:http://localhost:8000/#/admin

(3) 版本更新

docker-compose pull && docker-compose up
or
sudo docker-compose pull && sudo docker-compose up

Docker-compose.yml 配置说明

version: '2'
services:
  # Mysql数据库服务
  web_mysql:
    image: "daocloud.io/mysql:5.7"
    restart: always
    hostname: web_mysql

    # 目录映射及初始化数据库
    volumes:
        - "./mysql:/var/lib/mysql"
        - "./init:/docker-entrypoint-initdb.d/"

    # 端口映射, docker 内部访问可不对外开放   
    ports:
        - "3306:3306"

    # 配置数据库密码
    environment:
        MYSQL_ROOT_PASSWORD: "crediteaseitsec"

  # Redis 服务
  web_redis:
    image: "daocloud.io/redis"
    restart: always
    hostname: web_redis

    # redis启动命令及密码   
    command: redis-server --requirepass "crediteaseitsec"

    # 端口映射, docker 内部访问可不对外开放   
    ports:
          - "6379:6379"

  # 洞察后端
  backend:
    image: "crediteaseitsec/insight2"
    restart: always
    # 端口映射, docker 内部访问可不对外开放
    ports:
     - "8001:8000"

    # 日志目录映射
    volumes:
        - "./backend_logs:/app/insight2/logs"

    # 后端使用supervisor启动
    command:
     - /usr/bin/bash
     - -c
     - |
       supervisord -c /app/insight2/supervisord.conf
       while true;do sleep 100;done
    depends_on:
     - "web_mysql"
     - "web_redis"
    links:
     - "web_mysql"
     - "web_redis"

  # 洞察前端
  front:
    image: "crediteaseitsec/insight2_front"
    restart: always

    # 对外访问端口映射,需要配置,数据库,redis,后端都属于docker 内部访问,可不进行端口映射
    ports:
     - "8000:80"

    # 日志目录映射
    volumes:
     - "./front_logs:/logs"

    depends_on:
     - "backend"
Copyright Cesec Dev Team 2020 all right reserved,powered by Gitbook该文章修订时间: 2020-07-09 10:05:32

results matching ""

    No results matching ""