SIGN IN SIGN UP
reworkd / AgentGPT UNCLAIMED

🤖 Assemble, configure, and deploy autonomous AI Agents in your browser.

0 0 1 TypeScript
#!/usr/bin/env sh
2023-05-09 22:01:31 +03:00
cd /next
dos2unix wait-for-db.sh
2023-05-09 22:01:31 +03:00
# copy .env file if not exists
2023-05-09 23:04:22 -07:00
[ ! -f .env ] && [ -f .env.example ] && cp .env.example .env
cp .env .env.temp
dos2unix .env.temp
cat .env.temp > .env
rm .env.temp
2023-05-09 23:04:22 -07:00
source .env
2023-05-09 22:01:31 +03:00
2023-05-09 23:04:22 -07:00
# Ensure DB is available before running Prisma commands
2023-10-18 21:15:45 -07:00
./wait-for-db.sh agentgpt_db 3307
2023-05-09 22:01:31 +03:00
2023-05-09 23:04:22 -07:00
# Run Prisma commands
2023-05-09 22:01:31 +03:00
if [[ ! -f "/app/prisma/${DATABASE_URL:5}" ]]; then
2023-05-10 11:21:02 -07:00
npx prisma migrate deploy --name init
2023-05-09 22:01:31 +03:00
npx prisma db push
fi
2023-05-09 23:04:22 -07:00
# Generate Prisma client
npx prisma generate
2023-05-09 22:01:31 +03:00
# run cmd
exec "$@"