From 96b4cb79890cb913cfe6f608d141b00a66fe9fd5 Mon Sep 17 00:00:00 2001 From: fanxb Date: Tue, 29 Nov 2022 23:35:40 +0800 Subject: [PATCH 1/4] deploy --- Dockerfile | 2 +- build.sh | 1 - openRenamerBackend/start.sh | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 286971b..071c184 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM node:lts-buster-slim WORKDIR /app COPY ./openRenamerBackend /app -RUN chmod 777 -R /app +RUN chmod 777 -R /app && npm config set registry=https://registry.npmmirror.com && npm install -g typescript ENV PORT 80 CMD ["bash", "start.sh"] diff --git a/build.sh b/build.sh index cde2dda..19124f4 100644 --- a/build.sh +++ b/build.sh @@ -2,7 +2,6 @@ base=$(cd "$(dirname "$0")";pwd) cd $base docker run -it --rm --name buildOpenRenamer --user ${UID} -v $base/openRenamerFront:/opt/front node:lts-buster-slim bash -c "cd /opt/front && yarn --registry https://registry.npmmirror.com && yarn build" -docker run -it --rm --name buildOpenRenamer -v $base/openRenamerBackend:/app node:lts-buster-slim bash -c "cd /app && npm config set registry=https://registry.npmmirror.com && npm install -g typescript && tsc" rm -rf openRenamerBackend/static/* touch openRenamerBackend/static/.gitkeep diff --git a/openRenamerBackend/start.sh b/openRenamerBackend/start.sh index d064bb2..2f3380f 100644 --- a/openRenamerBackend/start.sh +++ b/openRenamerBackend/start.sh @@ -1 +1 @@ -npm config set registry=https://registry.npmmirror.com && npm install && tsc && node dist/index.js \ No newline at end of file +npm install && tsc && node dist/index.js \ No newline at end of file From 197c1b83426127fe771fb2eff43c7c5f48cee7fa Mon Sep 17 00:00:00 2001 From: fanxb Date: Tue, 29 Nov 2022 23:52:34 +0800 Subject: [PATCH 2/4] deploy: --- build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.sh b/build.sh index 19124f4..6d1b032 100644 --- a/build.sh +++ b/build.sh @@ -2,10 +2,12 @@ base=$(cd "$(dirname "$0")";pwd) cd $base docker run -it --rm --name buildOpenRenamer --user ${UID} -v $base/openRenamerFront:/opt/front node:lts-buster-slim bash -c "cd /opt/front && yarn --registry https://registry.npmmirror.com && yarn build" +docker run -it --rm --name buildOpenRenamer --user ${UID} -v $base/openRenamerBackend:/opt/app node:lts-buster-slim bash -c "cd /opt/app && yarn --registry https://registry.npmmirror.com && yarn global add typescript && yarn && tsc" rm -rf openRenamerBackend/static/* touch openRenamerBackend/static/.gitkeep mv openRenamerFront/dist/* openRenamerBackend/static +rm -rf openRenamerBackend/node_modules # 单平台打包并推送 #docker build -t fleyx/open-renamer:$0 --push . From 65bdd8c2fcc38a21ff9ba7afc645070fd7aafd6e Mon Sep 17 00:00:00 2001 From: fanxb Date: Tue, 29 Nov 2022 23:55:57 +0800 Subject: [PATCH 3/4] deploy: --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 071c184..f383b4c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM node:lts-buster-slim WORKDIR /app COPY ./openRenamerBackend /app -RUN chmod 777 -R /app && npm config set registry=https://registry.npmmirror.com && npm install -g typescript +RUN chmod 777 -R /app ENV PORT 80 CMD ["bash", "start.sh"] From 752193e419e3ee616e160392f93f0e0141b5d95a Mon Sep 17 00:00:00 2001 From: fanxb Date: Tue, 29 Nov 2022 11:10:45 -0500 Subject: [PATCH 4/4] =?UTF-8?q?deploy:=E4=BF=AE=E6=94=B9=E9=83=A8=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ build.sh | 4 ++-- openRenamerBackend/start.sh | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 99c25e6..645db1f 100644 --- a/.gitignore +++ b/.gitignore @@ -108,3 +108,5 @@ data /.idea/modules.xml /.idea/open-renamer.iml /.idea/vcs.xml + +package-lock.json \ No newline at end of file diff --git a/build.sh b/build.sh index 6d1b032..9af628f 100644 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ base=$(cd "$(dirname "$0")";pwd) cd $base docker run -it --rm --name buildOpenRenamer --user ${UID} -v $base/openRenamerFront:/opt/front node:lts-buster-slim bash -c "cd /opt/front && yarn --registry https://registry.npmmirror.com && yarn build" -docker run -it --rm --name buildOpenRenamer --user ${UID} -v $base/openRenamerBackend:/opt/app node:lts-buster-slim bash -c "cd /opt/app && yarn --registry https://registry.npmmirror.com && yarn global add typescript && yarn && tsc" +docker run -it --rm --name buildOpenRenamer --user ${UID} -v $base/openRenamerBackend:/opt/app node:lts-buster-slim bash -c "cd /opt/app && npm config set registry https://registry.npmmirror.com && npm install -g typescript && npm install && tsc" rm -rf openRenamerBackend/static/* touch openRenamerBackend/static/.gitkeep @@ -12,4 +12,4 @@ rm -rf openRenamerBackend/node_modules # 单平台打包并推送 #docker build -t fleyx/open-renamer:$0 --push . # 多平台打包并推送 -docker buildx build -t fleyx/open-renamer:$1 --platform linux/amd64,linux/arm64 --push . \ No newline at end of file +docker buildx build -t fleyx/open-renamer:$1 --platform linux/amd64,linux/arm64 --push . diff --git a/openRenamerBackend/start.sh b/openRenamerBackend/start.sh index 2f3380f..e1029a2 100644 --- a/openRenamerBackend/start.sh +++ b/openRenamerBackend/start.sh @@ -1 +1 @@ -npm install && tsc && node dist/index.js \ No newline at end of file +npm install && node dist/index.js