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