Auto restart containers
parent
ca816eca5a
commit
b9092eb8c2
|
@ -16,10 +16,10 @@ docker pull $IMAGE_NAME
|
||||||
AFTER_PULL=$(docker images -q $IMAGE_NAME)
|
AFTER_PULL=$(docker images -q $IMAGE_NAME)
|
||||||
|
|
||||||
# Compare the image IDs
|
# Compare the image IDs
|
||||||
# if [ "$BEFORE_PULL" == "$AFTER_PULL" ]; then
|
if [ "$BEFORE_PULL" == "$AFTER_PULL" ]; then
|
||||||
# echo "The Docker image has not been updated. Done!"
|
echo "The Docker image has not been updated. Done!"
|
||||||
# exit 0
|
exit 0
|
||||||
# fi
|
fi
|
||||||
|
|
||||||
echo "The Docker image has been updated, let's update the website content."
|
echo "The Docker image has been updated, let's update the website content."
|
||||||
git pull
|
git pull
|
||||||
|
@ -36,7 +36,7 @@ echo "Removing old databases"
|
||||||
rm -f $WEBSITE_SPACE/.silverbullet.db*
|
rm -f $WEBSITE_SPACE/.silverbullet.db*
|
||||||
|
|
||||||
echo "Starting new silverbullet container"
|
echo "Starting new silverbullet container"
|
||||||
docker run -d --name silverbullet -v $WEBSITE_SPACE:/space -e SB_READ_ONLY=1 -p $WEBSITE_PORT:3000 $IMAGE_NAME
|
docker run -d --name silverbullet --restart unless-stopped -v $WEBSITE_SPACE:/space -e SB_READ_ONLY=1 -p $WEBSITE_PORT:3000 $IMAGE_NAME
|
||||||
|
|
||||||
|
|
||||||
echo "Waiting for the servers to start"
|
echo "Waiting for the servers to start"
|
||||||
|
|
|
@ -33,7 +33,7 @@ cp -r scripts/playground_space/* $PLAYGROUND_SPACE/
|
||||||
cp -r website/Library $PLAYGROUND_SPACE/
|
cp -r website/Library $PLAYGROUND_SPACE/
|
||||||
|
|
||||||
echo "Starting new playground container"
|
echo "Starting new playground container"
|
||||||
docker run -d --name silverbullet-playground -v $PLAYGROUND_SPACE:/space -e SB_SHELL_BACKEND=off -p $PLAYGROUND_PORT:3000 $IMAGE_NAME
|
docker run -d --name silverbullet-playground --restart unless-stopped -v $PLAYGROUND_SPACE:/space -e SB_SHELL_BACKEND=off -p $PLAYGROUND_PORT:3000 $IMAGE_NAME
|
||||||
|
|
||||||
echo "Waiting for the server to start"
|
echo "Waiting for the server to start"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue