From 1592ed1b9e13e0f779964b6d7e5787f974f1f788 Mon Sep 17 00:00:00 2001 From: xiao Date: Fri, 1 Nov 2024 17:44:20 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9EDocker=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1777e04 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,33 @@ +FROM debian:bookworm + +COPY bt.sh /bt.sh +COPY ["ssh_host_*","/etc/ssh/"] + +# 设置构建参数 +ARG RANDOM_NAME + +# 设置一个btd12-前缀的随机主机名 +RUN echo "btd12-${RANDOM_NAME}" > /etc/hostname + +# 更新包列表并安装前置依赖及宝塔面板 +RUN apt-get update \ + && apt-get install -y wget iproute2 openssh-server libgd-dev cmake make gcc g++ autoconf \ + libsodium-dev libonig-dev libssh2-1-dev libc-ares-dev libaio-dev sudo curl \ + && curl -sSO http://download.bt.cn/install/install_panel.sh \ + && echo y|bash install_panel.sh -P 8888 --ssl-disable \ + && echo btpanel|bt 6 \ + && echo btpaneldocker|bt 5 \ + && echo "/btpanel" > /www/server/panel/data/admin_path.pl \ + && echo btpaneldocker | passwd root --stdin \ + && chmod +x /bt.sh \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* \ + && echo "dk_lib_test_d12" > /www/server/panel/data/o.pl + +ENTRYPOINT ["/bin/sh","-c","/bt.sh"] + +# 暴漏所有端口 +EXPOSE 0-65535 + +# 健康检查 +HEALTHCHECK --interval=5s --timeout=3s CMD curl -i http://127.0.0.1:$(cat /www/server/panel/data/port.pl)$(cat /www/server/panel/data/admin_path.pl) | grep -E '(200|404)' || exit 1 \ No newline at end of file