From 649523863931f883c55ecd1b23c9a990a520c96f Mon Sep 17 00:00:00 2001 From: xiao Date: Sat, 21 Dec 2024 09:17:17 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=9B=B4=E6=96=B0=20Dockerfile=20?= =?UTF-8?q?=E4=BB=A5=E4=BD=BF=E7=94=A8=E6=9B=B4=E5=B0=8F=E7=9A=84=E5=9F=BA?= =?UTF-8?q?=E7=A1=80=E9=95=9C=E5=83=8F=E5=B9=B6=E6=9A=B4=E9=9C=B2=E7=89=B9?= =?UTF-8?q?=E5=AE=9A=E7=AB=AF=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 787a80e..9fd7c28 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:bookworm +FROM debian:bookworm-slim # 切换 Debian 镜像源为腾讯云源,更新包列表并安装依赖 RUN sed -i 's/deb.debian.org/mirrors.tencent.com/g' /etc/apt/sources.list.d/debian.sources \ @@ -16,7 +16,7 @@ COPY ["bt.sh", "init_mysql.sh", "/"] # 转换启动脚本 RUN dos2unix /bt.sh && dos2unix /init_mysql.sh -# 下载并安装宝塔面板及 lnmp 环境 +# 下载并安装宝塔面板及 nginx RUN curl -sSO https://download.bt.cn/install/install_panel.sh \ && echo y | bash install_panel.sh -P 8888 --ssl-disable \ && mkdir /lnmp \ @@ -40,8 +40,8 @@ RUN echo btpanel | bt 6 \ ENTRYPOINT ["/bin/sh","-c","/bt.sh"] -# 暴漏所有端口 -EXPOSE 0-65535 +# 暴漏特定端口 +EXPOSE 22 80 443 888 3306 8888 # 健康检查 HEALTHCHECK --interval=5s --timeout=3s CMD prot="http"; if [ -f "/www/server/panel/data/ssl.pl" ]; then prot="https"; fi; curl -k -i $prot://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