forked from opq-osc/OPQ
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
22 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ LABEL MAINTAINER enjoy<[email protected]> | |
|
||
WORKDIR /apps | ||
COPY --from=build /apps/opqbot/ /apps/ | ||
|
||
COPY ./entrypoint.sh /apps/entrypoint.sh | ||
# 设置时区 | ||
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone | ||
|
||
|
@@ -25,7 +25,9 @@ ENV LANG C.UTF-8 | |
|
||
EXPOSE 8888 | ||
|
||
RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2 | ||
RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2 && chmod +x /apps/entrypoint.sh | ||
|
||
VOLUME [ "/apps/UsersConf" ] | ||
|
||
# 开RUN | ||
ENTRYPOINT ["/apps/OPQBot"] | ||
ENTRYPOINT ["/apps/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
if [[ "$token" == "" ]] ; then | ||
if [[ "$(awk -F= '$1 ~ /^Token.*$/ {gsub(/^\s*|\s*$|"/, "",$2);print $2}' CoreConf.conf)" != "" ]] ; then | ||
echo "使用配置文件中的Token运行" | ||
else | ||
echo "你Token呢?认真读文档啊喂 文档链接: https://github.com/opq-osc/OPQ/wiki/%E9%80%9A%E8%BF%87-Docker-%E5%AE%89%E8%A3%85 " | ||
exit 1 | ||
fi | ||
else | ||
sed -i "s/Token\s*=.*/Token = \"${token}\"/g" CoreConf.conf | ||
fi | ||
if [[ "$port" != "" ]] ; then | ||
sed -i "s/Port\s*=.*/Port = \"${port}\"/g" CoreConf.conf | ||
echo "已经将机器人地址设置为$port" | ||
fi | ||
echo "开始执行OPQBot" | ||
/apps/OPQBot |