mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Docker script updates
This commit is contained in:
parent
2eb6bb9a49
commit
e561cc871b
3 changed files with 31 additions and 6 deletions
|
@ -34,8 +34,7 @@ makeNextSubmodule() {
|
||||||
ln -sf "$PWD/submodules/${1}/out" "$PWD/nextStatic/${2}"
|
ln -sf "$PWD/submodules/${1}/out" "$PWD/nextStatic/${2}"
|
||||||
}
|
}
|
||||||
|
|
||||||
log 'Making project'
|
log "Making project"
|
||||||
log "Installing node modules for server"
|
|
||||||
npm install
|
npm install
|
||||||
npm audit fix
|
npm audit fix
|
||||||
npm run export
|
npm run export
|
||||||
|
@ -75,13 +74,15 @@ setupJson publicDirs/qminingPublic/news.json
|
||||||
touch publicDirs/qminingPublic/version
|
touch publicDirs/qminingPublic/version
|
||||||
touch publicDirs/qminingPublic/motd
|
touch publicDirs/qminingPublic/motd
|
||||||
|
|
||||||
if [ -z "$(ls -A ./src/standaloneUtils)" ]; then
|
if [ -z "$(ls -A ./data/dbs)" ]; then
|
||||||
pushd src/standaloneUtils
|
pushd src/standaloneUtils
|
||||||
NS_LOGLEVEL=2 node dbSetup.js
|
NS_LOGLEVEL=2 node dbSetup.js
|
||||||
mv *db ../../data/dbs
|
mv *.db ../../data/dbs
|
||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
npx --yes next telemetry disable
|
||||||
|
|
||||||
hr
|
hr
|
||||||
echo "Done!"
|
echo "Done!"
|
||||||
echo "npm start {loglevel}"
|
echo "npm start {loglevel}"
|
||||||
|
|
|
@ -1,8 +1,28 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
repoName='qminer/mrfrys-node-server'
|
||||||
|
|
||||||
|
function getContainerId() {
|
||||||
|
docker ps -a | grep -i "${repoName}" | xargs | cut -d' ' -f1
|
||||||
|
}
|
||||||
|
|
||||||
|
function getDockerRepoId() {
|
||||||
|
docker images | grep "${repoName}" | xargs | cut -d' ' -f3
|
||||||
|
}
|
||||||
|
|
||||||
if [ "$1" == "build" ]; then
|
if [ "$1" == "build" ]; then
|
||||||
docker build . -t qminer/mrfrys-node-server
|
docker build . -t qminer/mrfrys-node-server
|
||||||
exit
|
elif [ "$1" == "rebuild" ]; then
|
||||||
|
docker rmi -f $(getDockerRepoId)
|
||||||
|
docker build . -t qminer/mrfrys-node-server
|
||||||
|
elif [ "$1" == "build" ]; then
|
||||||
|
docker build . -t qminer/mrfrys-node-server
|
||||||
|
elif [ "$1" == "stop" ]; then
|
||||||
|
docker stop $(getContainerId)
|
||||||
|
elif [ "$1" == "start" ]; then
|
||||||
|
# --entrypoint bash \
|
||||||
|
scripts/setup.sh
|
||||||
|
docker start -i $(getContainerId)
|
||||||
elif [ "$1" == "run" ]; then
|
elif [ "$1" == "run" ]; then
|
||||||
# --entrypoint bash \
|
# --entrypoint bash \
|
||||||
scripts/setup.sh
|
scripts/setup.sh
|
||||||
|
@ -13,7 +33,7 @@ elif [ "$1" == "run" ]; then
|
||||||
--mount src="$(pwd)/publicDirs",target=/server/publicDirs,type=bind \
|
--mount src="$(pwd)/publicDirs",target=/server/publicDirs,type=bind \
|
||||||
qminer/mrfrys-node-server
|
qminer/mrfrys-node-server
|
||||||
elif [ "$1" == "bash" ]; then
|
elif [ "$1" == "bash" ]; then
|
||||||
docker exec -it "<container id>" /bin/bash
|
docker exec -it $(getContainerId) /bin/bash
|
||||||
else
|
else
|
||||||
echo 'params: "build" or "run"'
|
echo 'params: "build" or "run"'
|
||||||
fi
|
fi
|
||||||
|
|
4
scripts/start.sh
Executable file
4
scripts/start.sh
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
scripts/make.sh
|
||||||
|
npm run start
|
Loading…
Add table
Add a link
Reference in a new issue