28 lines
584 B
Bash
28 lines
584 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
set -e
|
||
|
|
||
|
up () {
|
||
|
docker run \
|
||
|
--detach \
|
||
|
--name cavereveryhour \
|
||
|
--restart unless-stopped \
|
||
|
--workdir /home/node/app \
|
||
|
--env NODE_ENV=production \
|
||
|
--volume $PWD/CaverEveryHour:/home/node/app:rw \
|
||
|
--volume $PWD/cavereveryhour.env:/home/node/app/.env:ro \
|
||
|
--volume /bigdata/tmp/EveryHourBot/CaverEveryHour:/home/node/app/media:ro \
|
||
|
docker.io/node:16 /bin/bash -c "npm install && node index.js"
|
||
|
}
|
||
|
|
||
|
down () {
|
||
|
docker stop cavereveryhour || true
|
||
|
docker rm cavereveryhour || true
|
||
|
}
|
||
|
|
||
|
logs () {
|
||
|
docker logs --follow cavereveryhour
|
||
|
}
|
||
|
|
||
|
$@
|