Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
birdup000 authored Jan 28, 2023
1 parent 494e4d1 commit 912ae77
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions install.docker.new.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ echo "cURL Version: $(curl --version | head -n 1)"
echo "Docker Version: $(docker -v)"
echo "Docker Compose Version: $(docker compose version)"

if command -v docker >/dev/null 2>&1; then
echo "Docker is not found. Please install Docker to continue."
exit 1
fi

if [ ! -f docker/.env ]
then
echo "Generating .env file..."
Expand All @@ -29,15 +34,26 @@ then
echo "TG_API_ID=$TG_API_ID" >> docker/.env
echo "TG_API_HASH=$TG_API_HASH" >> docker/.env
echo "ADMIN_USERNAME=$ADMIN_USERNAME" >> docker/.env
export DATABASE_URL="postgresql://postgres:$DB_PASSWORD@db:5432/teledrive"
export DATABASE_URL=postgresql://postgres:$DB_PASSWORD@db:5432/teledrive
echo "DB_PASSWORD=$DB_PASSWORD" >> docker/.env

cd docker
docker compose build teledrive
docker compose up -d
sleep 2
docker compose exec teledrive yarn workspace api prisma migrate deploy
else
git pull origin main

export $(cat docker/.env | xargs)

cd docker
docker compose down
docker compose up --build --force-recreate -d
sleep 2
docker compose up -d
docker compose exec teledrive yarn workspace api prisma migrate deploy
else
git reset --hard
git clean -f
git pull origin main
git pull origin main

1 comment on commit 912ae77

@vercel
Copy link

@vercel vercel bot commented on 912ae77 Jan 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.