Merge pull request 'dev' (#31) from dev into main

Reviewed-on: #31
This commit is contained in:
fanxb 2022-11-30 00:10:06 +08:00
commit e866f5488e
4 changed files with 7 additions and 4 deletions

2
.gitignore vendored
View File

@ -108,3 +108,5 @@ data
/.idea/modules.xml
/.idea/open-renamer.iml
/.idea/vcs.xml
package-lock.json

View File

@ -1,7 +1,7 @@
FROM node:lts-buster-slim
WORKDIR /app
COPY ./openRenamerBackend /app
RUN chmod 777 -R /app
RUN chmod 777 -R /app
ENV PORT 80
CMD ["bash", "start.sh"]

View File

@ -2,13 +2,14 @@
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"
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
mv openRenamerFront/dist/* openRenamerBackend/static
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 .
docker buildx build -t fleyx/open-renamer:$1 --platform linux/amd64,linux/arm64 --push .

View File

@ -1 +1 @@
npm config set registry=https://registry.npmmirror.com && npm install && tsc && node dist/index.js
npm install && node dist/index.js