Include autenticazione, progetti isolati, mail marketing HTML con SMTP, test A/B e editor WYSIWYG. Co-authored-by: Cursor <cursoragent@cursor.com>
22 lines
610 B
Bash
Executable File
22 lines
610 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
# Wait for postgres if DATABASE_HOST is set
|
|
if [ -n "${DATABASE_HOST}" ]; then
|
|
echo "Waiting for PostgreSQL at ${DATABASE_HOST}:${DATABASE_PORT:-5432}..."
|
|
until pg_isready -h "${DATABASE_HOST}" -p "${DATABASE_PORT:-5432}" -U "${POSTGRES_USER:-simplecrm}" >/dev/null 2>&1; do
|
|
sleep 1
|
|
done
|
|
echo "PostgreSQL is ready."
|
|
fi
|
|
|
|
# Prepare DB (create + migrate). Seed only when explicitly requested.
|
|
if [ "${RAILS_ENV}" = "production" ] || [ "${RAILS_ENV}" = "development" ]; then
|
|
./bin/rails db:prepare
|
|
if [ "${RUN_SEEDS}" = "true" ]; then
|
|
./bin/rails db:seed
|
|
fi
|
|
fi
|
|
|
|
exec "$@"
|