ConsulManager/install/docker-compose/tensuns_install_only.sh

50 lines
1.5 KiB
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#!/bin/bash
tsspath="/opt/tensuns"
mkdir -p $tsspath
cat <<EOF > $tsspath/docker-compose.yaml
version: '3.6'
services:
flask-consul:
image: swr.cn-south-1.myhuaweicloud.com/starsl.cn/flask-consul:latest
container_name: flask-consul
hostname: flask-consul
restart: always
volumes:
- /usr/share/zoneinfo/PRC:/etc/localtime
environment:
consul_token: xxxxx-xxxxx-xxxxx
consul_url: http://x.x.x.x:8500/v1
admin_passwd: xxxxxxxx
log_level: INFO
networks:
- TenSunS
nginx-consul:
image: swr.cn-south-1.myhuaweicloud.com/starsl.cn/nginx-consul:latest
container_name: nginx-consul
hostname: nginx-consul
restart: always
ports:
- "1026:1026"
volumes:
- /usr/share/zoneinfo/PRC:/etc/localtime
depends_on:
- flask-consul
networks:
- TenSunS
networks:
TenSunS:
name: TenSunS
driver: bridge
ipam:
driver: default
EOF
echo -e "\n编辑$tsspath/docker-compose.yaml修改3个环境变量\n\033[31;1mconsul_token\033[0mconsul的登录token安装consul时生成的UUID\n\033[31;1mconsul_url\033[0mconsul的URL(http开头/v1要保留)\n\033[31;1madmin_passwd\033[0m登录后羿运维平台admin用户的密码\n"
echo "启动cd $tsspath && docker-compose up -d"
echo -e "\n请使用浏览器访问 http://{你的IP}:1026 并登录使用\n"
echo -e "\033[31;1mhttp://`ip route get 1.2.3.4 | awk '{print $NF}'|head -1`:1026\033[0m\n"