From faedc09771783a1a5548ba93b872b011635462c5 Mon Sep 17 00:00:00 2001 From: fanxb Date: Wed, 10 May 2023 20:30:42 +0800 Subject: [PATCH] =?UTF-8?q?deploy:=E4=BF=AE=E6=94=B9=E9=83=A8=E7=BD=B2?= =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 4 +++- build.sh | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8d9f636..a57c355 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,9 @@ FROM node:lts-buster-slim WORKDIR /app COPY ./openRenamerBackend /app -RUN chmod 777 -R /app && npm install -g pnpm typescript --registry https://registry.npmmirror.com +# RUN chmod 777 -R /app && npm install -g pnpm typescript --registry https://registry.npmmirror.com +# 注意此处未添加npm代理 +RUN chmod 777 -R /app && npm install -g pnpm typescript ENV PORT 80 CMD ["bash", "start.sh"] diff --git a/build.sh b/build.sh index 88ac01e..973cff6 100644 --- a/build.sh +++ b/build.sh @@ -2,7 +2,9 @@ base=$(cd "$(dirname "$0")";pwd) cd $base rm -rf openRenamerBackend/dist -docker run -it --rm --name buildOpenRenamer --user ${UID} -v $base/openRenamerFront:/opt/front node:lts-slim bash -c "cd /opt/front && npm install -g pnpm --registry https://registry.npmmirror.com && pnpm install --registry https://registry.npmmirror.com && pnpm run build" +# 注意此处未添加npm代理 +# docker run -it --rm --name buildOpenRenamer --user ${UID} -v $base/openRenamerFront:/opt/front node:lts-slim bash -c "cd /opt/front && npm install -g pnpm --registry https://registry.npmmirror.com && pnpm install --registry https://registry.npmmirror.com && pnpm run build" +docker run -it --rm --name buildOpenRenamer --user ${UID} -v $base/openRenamerFront:/opt/front node:lts-slim bash -c "cd /opt/front && npm install -g pnpm && pnpm install && pnpm run build" rm -rf openRenamerBackend/static/* touch openRenamerBackend/static/.gitkeep