From 6e48d3f86cd77061ed74541d62ea4b8688655e5f Mon Sep 17 00:00:00 2001 From: Arunavo Ray Date: Thu, 22 May 2025 19:29:15 +0530 Subject: [PATCH] refactor: remove bun setup for pre-built images and streamline database initialization scripts --- docker-entrypoint.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 836381e..52fbe94 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -5,11 +5,8 @@ set -e # Ensure data directory exists mkdir -p /app/data -# If bun is available, run setup (for dev images) -if command -v bun >/dev/null 2>&1; then - echo "Running bun setup (if needed)..." - bun run setup || true -fi +# Skip dependency installation entirely for pre-built images +# Dependencies are already installed during the Docker build process # Initialize the database if it doesn't exist if [ ! -f "/app/data/gitea-mirror.db" ]; then @@ -18,6 +15,8 @@ if [ ! -f "/app/data/gitea-mirror.db" ]; then bun dist/scripts/init-db.js elif [ -f "dist/scripts/manage-db.js" ]; then bun dist/scripts/manage-db.js init + elif [ -f "scripts/manage-db.ts" ]; then + bun scripts/manage-db.ts init else echo "Warning: Could not find database initialization scripts in dist/scripts." echo "Creating and initializing database manually..." @@ -155,6 +154,8 @@ else bun dist/scripts/fix-db-issues.js elif [ -f "dist/scripts/manage-db.js" ]; then bun dist/scripts/manage-db.js fix + elif [ -f "scripts/manage-db.ts" ]; then + bun scripts/manage-db.ts fix fi # Run database migrations