用到的外部中间件有: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"
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"
然后创建数据库:
$ 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"
至此,jumpserver就已经安装完成了,然后登录界面进行配置即可了。
参考文献:
https://docs.jumpserver.org/zh/docs/dockerinstall.html
https://www.cnblogs.com/tangqingsong/p/9880248.html