One click installation script
This commit is contained in:
78
docker-compose.yml
Normal file
78
docker-compose.yml
Normal file
@@ -0,0 +1,78 @@
|
||||
version: "3.6"
|
||||
|
||||
services:
|
||||
fizz-mysql:
|
||||
image: "fizzgate/fizz-mysql:2.6.1"
|
||||
container_name: fizz-mysql
|
||||
restart: always
|
||||
hostname: fizz-mysql
|
||||
ports:
|
||||
- "3306:3306"
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD=root123456
|
||||
- MYSQL_DATABASE=fizz_manager
|
||||
volumes:
|
||||
- "./docker_volumes/mysql:/var/lib/mysql"
|
||||
networks:
|
||||
- fizz
|
||||
|
||||
fizz-redis:
|
||||
image: "redis:6.0.8"
|
||||
container_name: fizz-redis
|
||||
restart: always
|
||||
hostname: fizz-redis
|
||||
ports:
|
||||
- "6379:6379"
|
||||
networks:
|
||||
- fizz
|
||||
|
||||
fizz-gateway-community:
|
||||
image: "fizzgate/fizz-gateway-community:2.6.1"
|
||||
container_name: fizz-gateway-community
|
||||
restart: always
|
||||
hostname: fizz-gateway-community
|
||||
links:
|
||||
- fizz-redis
|
||||
depends_on:
|
||||
- fizz-manager-professional
|
||||
ports:
|
||||
- "8600:8600"
|
||||
environment:
|
||||
- aggregate.redis.host=fizz-redis
|
||||
- aggregate.redis.port=6379
|
||||
- aggregate.redis.password=
|
||||
- aggregate.redis.database=9
|
||||
volumes:
|
||||
- "./docker_volumes/fizz-gateway-community/logs:/opt/fizz-gateway-community/logs"
|
||||
networks:
|
||||
- fizz
|
||||
|
||||
fizz-manager-professional:
|
||||
image: "fizzgate/fizz-manager-professional:2.6.1"
|
||||
container_name: fizz-manager-professional
|
||||
restart: always
|
||||
hostname: fizz-manager-professional
|
||||
links:
|
||||
- fizz-redis
|
||||
- fizz-mysql
|
||||
depends_on:
|
||||
- fizz-mysql
|
||||
- fizz-redis
|
||||
ports:
|
||||
- "8000:8000"
|
||||
environment:
|
||||
- spring.redis.host=fizz-redis
|
||||
- spring.redis.port=6379
|
||||
- spring.redis.password=
|
||||
- spring.redis.database=9
|
||||
- "spring.datasource.url=jdbc:mysql://fizz-mysql:3306/fizz_manager?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true"
|
||||
- spring.datasource.username=root
|
||||
- spring.datasource.password=root123456
|
||||
volumes:
|
||||
- "./docker_volumes/fizz-manager-professional/logs:/opt/fizz-manager-professional/logs"
|
||||
networks:
|
||||
- fizz
|
||||
|
||||
networks:
|
||||
fizz:
|
||||
driver: bridge
|
||||
81
install.sh
Normal file
81
install.sh
Normal file
@@ -0,0 +1,81 @@
|
||||
#!/bin/bash
|
||||
# ----------------------------------------------------------------------
|
||||
# use : wget https://github.com/wehotel/fizz-gateway-community/raw/master/install.sh && bash install.sh
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
# abort on errors
|
||||
set -e
|
||||
|
||||
port="$1"
|
||||
|
||||
# 安装docker
|
||||
if ! [ -x "$(command -v docker)" ]; then
|
||||
echo '检测到 Docker 尚未安装,正在尝试安装 Docker ...'
|
||||
|
||||
if [ -x "$(command -v yum)" ]; then
|
||||
sudo yum install -y python3-pip yum-utils device-mapper-persistent-data lvm2
|
||||
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
|
||||
yum list docker-ce --showduplicates | sort -r
|
||||
sudo yum install docker-ce
|
||||
else
|
||||
sudo apt-get update
|
||||
sudo dpkg --configure -a
|
||||
sudo apt-get install python3-pip apt-transport-https ca-certificates curl software-properties-common
|
||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
|
||||
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
|
||||
sudo apt-get update
|
||||
sudo apt-get install docker-ce
|
||||
fi
|
||||
|
||||
# 启动docker和开机自启动
|
||||
sudo systemctl start docker
|
||||
sudo systemctl enable docker
|
||||
fi
|
||||
|
||||
|
||||
# 安装docker-compose
|
||||
if ! [ -x "$(command -v docker-compose)" ]; then
|
||||
echo '检测到 Docker-Compose 尚未安装,正在尝试安装 Docker-Compose ...'
|
||||
if ! [ -x "$(command -v pip3)" ]; then
|
||||
curl -L https://github.com/docker/compose/releases/download/1.25.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
|
||||
chmod +x /usr/local/bin/docker-compose
|
||||
else
|
||||
pip3 install --upgrade pip
|
||||
pip3 install docker-compose
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# 开始安装Fizz
|
||||
if [ -x "$(command -v docker)" -a -x "$(command -v docker-compose)" ]; then
|
||||
docker version
|
||||
docker-compose -version
|
||||
|
||||
# 安装Fizz
|
||||
if [ ! -f "docker-compose.yml" ];then
|
||||
wget https://github.com/wehotel/fizz-gateway-community/raw/master/docker-compose.yml
|
||||
fi
|
||||
|
||||
if [ ! -f "/etc/docker/daemon.json" ];then
|
||||
sudo mkdir -p /etc/docker
|
||||
echo -E '{"registry-mirrors": ["https://kn77wnbv.mirror.aliyuncs.com"]}' > /etc/docker/daemon.json
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl restart docker
|
||||
fi
|
||||
|
||||
docker-compose up -d
|
||||
|
||||
else
|
||||
|
||||
if ! [ -x "$(command -v docker)" ]; then
|
||||
echo 'Docker 安装失败,请检测您当前的环境(或网络)是否正常。'
|
||||
fi
|
||||
|
||||
|
||||
if ! [ -x "$(command -v docker-compose)" ]; then
|
||||
echo 'Docker-Compose 安装失败,请检测您当前的环境(或网络)是否正常。'
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
rm -f install.sh
|
||||
Reference in New Issue
Block a user