jumpserver-docker-compose部署

官网地址:https://docs.jumpserver.org/zh/master/install/docker_install/

1 linux生成随机key密钥

if [ ! "$SECRET_KEY" ]; then
  SECRET_KEY=`cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 50`;
  echo "SECRET_KEY=$SECRET_KEY" >> ~/.bashrc;
  echo $SECRET_KEY;
else
  echo $SECRET_KEY;
fi  
if [ ! "$BOOTSTRAP_TOKEN" ]; then
  BOOTSTRAP_TOKEN=`cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 16`;
  echo "BOOTSTRAP_TOKEN=$BOOTSTRAP_TOKEN" >> ~/.bashrc;
  echo $BOOTSTRAP_TOKEN;
else
  echo $BOOTSTRAP_TOKEN;
fi

2 拉取代码

git clone https://github.com/jumpserver/Dockerfile.git
cd Dockerfile
cp config_example.conf .env
cat .env
docker-compose up

3 自定义修改(生产请务必操作)

3.1 生成密钥

cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 49;echo

3.2 修改mysql密码

DB_PASSWORD=

3.3 修改redis密码

REDIS_PASSWORD=

4 启动

docker-compose up -d

特殊说明(如果)