2024-04-02 14:41:07 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2024-04-02 19:33:26 +00:00
|
|
|
# Function to check if the database is ready
|
|
|
|
wait_for_db() {
|
|
|
|
echo "Waiting for the database to start up..."
|
|
|
|
while ! nc -z db 5432; do
|
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
echo "Database is now available."
|
|
|
|
}
|
|
|
|
|
2024-04-02 14:41:07 +00:00
|
|
|
# Start your application here
|
2024-04-02 19:33:26 +00:00
|
|
|
# Print message
|
2024-04-02 18:04:27 +00:00
|
|
|
echo "Starting AdventureLog"
|
2024-04-02 19:33:26 +00:00
|
|
|
|
|
|
|
# Wait for the database to start up
|
2024-04-18 01:24:00 +00:00
|
|
|
if [ -z "$SKIP_DB_WAIT" ] || [ "$SKIP_DB_WAIT" = "false" ]; then
|
2024-04-18 01:15:52 +00:00
|
|
|
wait_for_db
|
|
|
|
fi
|
2024-04-02 19:33:26 +00:00
|
|
|
|
|
|
|
# Run database migration
|
2024-04-02 14:41:07 +00:00
|
|
|
npm run migrate
|
2024-04-02 19:33:26 +00:00
|
|
|
|
2024-04-11 22:58:54 +00:00
|
|
|
echo "The origin to be set is: $ORIGIN"
|
2024-04-02 19:33:26 +00:00
|
|
|
# Start the application
|
2024-04-10 13:30:54 +00:00
|
|
|
ORIGIN=$ORIGIN node build
|