File tree Expand file tree Collapse file tree 5 files changed +27
-13
lines changed Expand file tree Collapse file tree 5 files changed +27
-13
lines changed Original file line number Diff line number Diff line change 1
1
Dockerfile
2
- docker.sh
3
- install.sh
2
+ dockersh /
3
+ black.sh
4
+ .git /
5
+ .gitignore
6
+ .gitmodules
7
+ pluginsDev /
8
+ pluginsServer /
Original file line number Diff line number Diff line change 55
55
with :
56
56
context : .
57
57
push : true
58
- tags : amiyabot/amiyabot:latest
58
+ tags : amiyabot/amiyabot:2.0.2, amiyabot/amiyabot: latest
Original file line number Diff line number Diff line change @@ -10,12 +10,18 @@ WORKDIR /app
10
10
# 守护端口
11
11
EXPOSE 8088
12
12
13
- # 拷贝当前目录下的所有文件到工作目录
13
+ # 工作目录
14
14
COPY requirements.txt /app
15
15
COPY entrypoint.sh /app
16
- COPY . /temp
17
- RUN tar -zcvf amiyabot.tar.gz --exclude=/temp/.git --exclude=/temp/.vscode --exclude=/temp/.idea --exclude=/temp/docker.sh \
18
- --exclude=/temp/entrypoint.sh --exclude=/temp/install.sh --exclude=/temp/Dockerfile /temp/*
16
+
17
+ # 临时目录
18
+ COPY . /app/temp
19
+ WORKDIR /app/temp
20
+ RUN tar -zcvf amiyabot.tar.gz --exclude=.git --exclude=.vscode --exclude=.idea --exclude=docker.sh \
21
+ --exclude=entrypoint.sh --exclude=install.sh --exclude=Dockerfile *
22
+ RUN mv amiyabot.tar.gz /app
23
+ WORKDIR /app
24
+ RUN rm -rf temp
19
25
20
26
# 安装依赖
21
27
RUN pip install -r requirements.txt
Original file line number Diff line number Diff line change @@ -161,7 +161,9 @@ while true; do
161
161
read confirm
162
162
if [ " $confirm " ]; then
163
163
if [ " $confirm " = " y" ]; then
164
+ sudo docker pull amiyabot/amiyabot:latest
164
165
eval $command
166
+ echo " 服务已启动, 控制台地址: http://<本机ip>:$port "
165
167
break
166
168
elif [ " $confirm " = " n" ]; then
167
169
echo " 已取消"
Original file line number Diff line number Diff line change 2
2
3
3
BOT_FOLDER=/amiyabot
4
4
5
- if [ ! -f " $BOT_FOLDER /first_run " ] ; then
6
- # step 1: 解压bot本体
5
+ # step 1: 解压/覆盖bot文件
6
+ if [ -f " amiyabot.tar.gz " ] ; then
7
7
tar -zxvf amiyabot.tar.gz -C $BOT_FOLDER
8
- # step 2: 进入bot目录
8
+ fi
9
+
10
+ # step 2: 判断是否首次运行
11
+ if [ ! -f " $BOT_FOLDER /first_run" ]; then
9
12
cd $BOT_FOLDER
10
- # step 3: 初始化配置文件
11
13
python entrypoint.py
12
- # step 4: 标记已初始化
13
14
touch first_run
14
15
fi
15
16
16
- # step 5: 运行bot
17
+ # step 3: 启动bot
17
18
cd $BOT_FOLDER
18
19
python amiya.py
You can’t perform that action at this time.
0 commit comments