1 Deploy with Docker
cworld1 edited this page 2023-02-14 01:08:02 +08:00

使用 Docker 构建

1. 安装 dockerdocker-compose

curl -fsSL https://get.docker.com | bash -s docker
sudo curl -L "https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
docker-compose version

不同系统安装命令可能略有差异,详见:Docker Documentation

2. 克隆本项目

git clone https://github.com/luoshuijs/TGPaimonBot.git
cd TGPaimonBot

3. 修改配置文件

cp .env.example .env
cp docker-compose.gen.yml docker-compose.yml
# MySQL
DB_HOST=mysql
DB_PORT=3306
DB_USERNAME=root
DB_PASSWORD="root"
DB_DATABASE=paimon

# Redis
REDIS_HOST=redis
REDIS_PORT=6379
REDIS_DB=0
REDIS_PASSWORD=""

以及 bot token 等参数。详见 Env Settings

4. 运行

docker-compose up -d