init commit

This commit is contained in:
2025-08-17 11:44:54 +09:00
commit 5592014530
59 changed files with 3175 additions and 0 deletions

20
docker/entrypoint.sh Executable file
View File

@@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -euo pipefail
echo "[entrypoint] Waiting for MariaDB at ${DB_HOST:-db}:${DB_PORT:-3306}..."
until mariadb -h "${DB_HOST:-db}" -P "${DB_PORT:-3306}" -u"${DB_USER:-root}" -p"${DB_PASSWORD:-}" -e "SELECT 1" >/dev/null 2>&1; do
sleep 1
done
echo "[entrypoint] MariaDB is up"
if [ "${RUN_MIGRATIONS:-true}" = "true" ]; then
if [ -f "/app/alembic.ini" ] && [ -d "/app/migrations" ]; then
echo "[entrypoint] Running alembic upgrade head"
alembic upgrade head || echo "[entrypoint] Alembic failed (non-fatal)"
else
echo "[entrypoint] Skipping alembic — no /app/migrations or alembic.ini"
fi
fi
echo "[entrypoint] Starting: $*"
exec "$@"