• docker搭建堡垒机jumpserver


    用到的外部中间件有:redis、mysql

    1、docker搭建redis

    version: "3"
    services:
      redis:
        image: redis:5.0.4
        container_name: redis
        ports:
          - "6379:6379"
        volumes:
          - "/mnt/redis/data:/data"
          - "/etc/localtime:/etc/localtime:ro"
        command: --requirepass "waveRedisAdmin123" --appendonly yes
        deploy:
          resources:
            limits:
              cpus: '0.5'
              memory: 4G
        restart: always
        logging:
          driver: "json-file"
          options:
            max-size: "10m"
            max-file: "3"
    redis.yaml

    2、docker搭建mysql

    version: "3"
    services:
      mysql:
        image: mysql:5.7.25
        container_name: mysql
        ports:
          - "3306:3306"
        volumes:
          - "/mnt/mysql:/var/lib/mysql"
          - "/etc/localtime:/etc/localtime:ro"
        environment:
          - "MYSQL_ROOT_PASSWORD=Develop123"
        deploy:
          resources:
            limits:
              cpus: '2'
              memory: 4G
        restart: always
        logging:
          driver: "json-file"
          options:
            max-size: "10m"
            max-file: "3"
    mysql.yaml

    然后创建数据库:

    $ create database jumpserver default charset 'utf8';
    $ grant all on jumpserver.* to 'jumpserver'@'%' identified by '123456';

    3、安装jms_all

    version: "3"
    services:
      jms:
        image: jumpserver/jms_all:latest
        container_name: jms
        environment:
          - SECRET_KEY=AnmzvvkdDT4iVSeGWEdfAkzF8FRSo3kR6lVUjIQtvsmqZ5RVW4
          - BOOTSTRAP_TOKEN=fhNYqK9Oxc44cFfK
          - DB_HOST=193.168.1.41
          - DB_PORT=3306
          - DB_USER=jumpserver
          - DB_PASSWORD=123456
          - DB_NAME=jumpserver
          - REDIS_HOST=193.168.1.41
          - REDIS_PORT=6379
          - LOG_LEVEL=INFO
          - REDIS_PASSWORD=RedisAdmin123
        ports:
          - "2222:2222"
          - "80:80"
        volumes:
          - /data/volumes/jumpserver/data/media:/opt/jumpserver/data/media
        restart: always
        network_mode: host
        logging:
          driver: "json-file"
          options:
            max-size: "10m"
            max-file: "3"
    jms_all.yaml

    至此,jumpserver就已经安装完成了,然后登录界面进行配置即可了。

    参考文献:

    https://docs.jumpserver.org/zh/docs/dockerinstall.html

    https://www.cnblogs.com/tangqingsong/p/9880248.html

  • 相关阅读:
    mongoDB
    昆仑会员此打印方式只针对用会员卡结账的消费,放开限制解决方案
    用jdk1.6的pack200和unpack200,对jar文件进行压缩和解压 .pack.gz
    ffmpeg
    关于golang-mod的使用方法
    组件&Props
    元素渲染
    JSX 简介
    React-HelloWorld
    Vue与REACT两个框架的区别和优势对比
  • 原文地址:https://www.cnblogs.com/caibao666/p/12503717.html
Copyright © 2020-2023  润新知