This commit is contained in:
728
2022-11-29 14:56:49 +08:00
parent fa37b2f079
commit 5a84c03586
5 changed files with 70 additions and 1 deletions

2
.gitignore vendored
View File

@ -5,3 +5,5 @@
/dbimport
/dbexport
/json
/release
*.zip

7
cli/deploy.zsh Normal file
View File

@ -0,0 +1,7 @@
rm -rf ismism/cli
rm -rf ismism/ismism.ts
rm -rf ismism/ui
unzip ismism.zip -d ismism
rm ismism.zip deploy.zsh

18
cli/release.zsh Normal file
View File

@ -0,0 +1,18 @@
rm -rf release
git clone --depth 1 git@gitlab.com:728/ismism.git release
rm -rf release/.git
zsh cli/build.zsh
cp -r ui release
if [ "$1" = "dbimport" ]; then
echo "cp -r dbimport release"
cp -r dbimport release
fi
rm -f ismism.zip
cd release
zip -r ../ismism.zip .
cd ..
scp -i ~/work/ismism/72eight.pem -r ismism.zip root@43.154.15.138:/root/
scp -i ~/work/ismism/72eight.pem -r cli/deploy.zsh root@43.154.15.138:/root/

View File

@ -1,6 +1,15 @@
rm -rf log; mkdir log
nohup mongod --config mongod.yaml > log/mongod.log &
if systemctl > /dev/null; then
chown -R mongodb:mongodb /var/lib/mongodb
chown mongod:mongod /tmp/mongodb-27017.sock
cp -f mongod.service /lib/systemd/system/
systemctl daemon-reload
systemctl start mongod
else
nohup mongod --config mongod.yaml > log/mongod.log &
fi
nohup deno run --allow-net --allow-read ismism.ts/src/serve.ts > log/ismism.log &
nohup nginx -p . -c nginx.conf > log/nginx.log &

33
mongod.service Normal file
View File

@ -0,0 +1,33 @@
Description=MongoDB Database Server
Documentation=https://docs.mongodb.org/manual
After=network-online.target
Wants=network-online.target
[Service]
User=mongodb
Group=mongodb
EnvironmentFile=-/etc/default/mongod
WorkingDirectory=/root/ismism
ExecStart=mongod --config mongod.yaml
PIDFile=/var/run/mongodb/mongod.pid
# file size
LimitFSIZE=infinity
# cpu time
LimitCPU=infinity
# virtual memory size
LimitAS=infinity
# open files
LimitNOFILE=64000
# processes/threads
LimitNPROC=64000
# locked memory
LimitMEMLOCK=infinity
# total threads (user+kernel)
TasksMax=infinity
TasksAccounting=false
# Recommended limits for mongod as specified in
# https://docs.mongodb.com/manual/reference/ulimit/#recommended-ulimit-settings
[Install]
WantedBy=multi-user.target