cavepedia/docker.sh

51 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
set -e
RELEASE=2.3
build () {
echo "Building cavepedia/cavepedia:$RELEASE"
docker build -t cavepedia/cavepedia:$RELEASE ./src
}
import_data () {
echo "Importing cavepedia.bleve version $RELEASE"
if [ ! -f ./cavepedia-$RELEASE.zip ]; then
cp -r /bigdata/archive/cavepedia/release/cavepedia-$RELEASE.zip .
unzip cavepedia-$RELEASE.zip
fi
}
up () {
build
import_data
docker network create --ipv6 pew-net || true
# Exposed on port 3000 on pew-net
docker run \
--detach \
--name cavepedia \
--restart unless-stopped \
--label com.centurylinklabs.watchtower.enable=false \
--env PROXY=1 \
--env-file cavepedia.env \
--volume $PWD/cavepedia-$RELEASE/cavepedia-data:/go/src/app/cavepedia-data:ro \
--volume $PWD/cavepedia-$RELEASE/cavepedia.bleve:/go/src/app/cavepedia.bleve:rw \
--network pew-net \
cavepedia/cavepedia:$RELEASE
}
down () {
docker stop cavepedia || true
docker rm cavepedia || true
}
logs () {
docker logs --follow cavepedia
}
$@