set -e

NETWORK_NAME=medicine-network
if [ -z $(docker network ls --filter name=^${NETWORK_NAME}$ --format="{{ .Name }}") ] ; then
  docker network create ${NETWORK_NAME} ;
fi

echo "readonly" | docker login docker.med-logic.ru --username readonly --password-stdin

docker pull docker.med-logic.ru/medicine-dashboard:latest
docker tag docker.med-logic.ru/medicine-dashboard:latest medicine-dashboard:latest

docker compose up -d
