From 0f572f4cb3bed8db922ebb53a42dd0bf96e29723 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Mon, 4 Nov 2024 13:32:02 +0800 Subject: [PATCH] chore: --- packages/ui/Dockerfile | 14 +++++++++++++- start.sh | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/ui/Dockerfile b/packages/ui/Dockerfile index 26d321ff..337b8ca2 100644 --- a/packages/ui/Dockerfile +++ b/packages/ui/Dockerfile @@ -10,13 +10,25 @@ RUN npm install -g pnpm@8.15.7 RUN cp /workspace/certd-client/dist/* /workspace/certd-server/public/ -rf RUN cd /workspace/certd-server && pnpm install && npm run build-on-docker - FROM node:18-alpine RUN apk add --no-cache openssl RUN apk add --no-cache openjdk8 WORKDIR /app/ COPY --from=builder /workspace/certd-server/ /app/ +ENV LEGO_VERSION=4.19.2 +ENV LEGO_DOWNLOAD_DIR /app/tools/linux +RUN mkdir -p $LEGO_DOWNLOAD_DIR + +# 根据架构下载不同的文件 +RUN ARCH=$(uname -m) && \ + if [ "$ARCH" = "x86_64" ]; then \ + wget -O $LEGO_DOWNLOAD_DIR/lego_linux_amd64.tar.gz https://github.com/go-acme/lego/releases/download/v${LEGO_VERSION}/lego_v${LEGO_VERSION}_linux_arm64.tar.gz; \ + elif [ "$ARCH" = "aarch64" ]; then \ + wget -O $LEGO_DOWNLOAD_DIR/lego_linux_arm64.tar.gz https://github.com/go-acme/lego/releases/download/v${LEGO_VERSION}/lego_v${LEGO_VERSION}_linux_amd64.tar.gz; \ + else \ + echo "Unsupported architecture: $ARCH"; \ + fi ENV TZ=Asia/Shanghai ENV NODE_ENV=production diff --git a/start.sh b/start.sh index ad46a26b..dd4edb46 100755 --- a/start.sh +++ b/start.sh @@ -1,6 +1,6 @@ # set -e -echo "即将删除packages下除ui之外的其他目录,按y确认" +echo "即将删除packages下除ui之外的其他目录,按y确认(如果您没有修改过源码,按y即可)" read -p "y/n: " confirm if [ $confirm != "y" ]; then echo "取消操作"