2023-11-26 00:25:28 +01:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Function to check if the database is healthy
|
|
|
|
check_database() {
|
|
|
|
until nc -z -w 1 "$DB_HOST" "$DB_PORT"; do
|
|
|
|
>&2 echo "[JET] Waiting for MySQL to be ready..."
|
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
>&2 echo "[JET] MySQL is ready"
|
|
|
|
}
|
|
|
|
|
|
|
|
# Check if the database is healthy
|
|
|
|
check_database
|
|
|
|
|
|
|
|
# Start the Express app
|
2024-01-09 08:28:18 +01:00
|
|
|
exec bun run start
|