mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
37 lines
1.1 KiB
Bash
Executable file
37 lines
1.1 KiB
Bash
Executable file
#!/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
|
|
docker build . -t qminer/mrfrys-node-server
|
|
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 \
|
|
docker start -i $(getContainerId)
|
|
elif [ "$1" == "run" ]; then
|
|
# --entrypoint bash \
|
|
docker run -it \
|
|
-p 8080:80 \
|
|
--mount src="$(pwd)/stats",target=/server/stats,type=bind \
|
|
--mount src="$(pwd)/data",target=/server/data,type=bind \
|
|
--mount src="$(pwd)/publicDirs",target=/server/publicDirs,type=bind \
|
|
qminer/mrfrys-node-server
|
|
elif [ "$1" == "bash" ]; then
|
|
docker exec -it $(getContainerId) /bin/bash
|
|
else
|
|
echo 'params: "build" or "run"'
|
|
fi
|