entrypoint update

This commit is contained in:
Ryan 2025-04-09 23:14:24 +10:00
parent a0acc77b4b
commit 5d5a0bf390

View File

@ -1,9 +1,11 @@
#!/bin/sh
set -ex
# Update apt repository, install git, and verify installation.
apt-get update -y && apt-get install -y git && rm -rf /var/lib/apt/lists/*
echo "Git version:" $(git --version)
echo "Starting entrypoint script..."
# Update apt repository, install git, and remove apt cache
apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
echo "Git version: $(git --version)"
PROJECT_DIR="/app/my-medusa-app"
@ -12,10 +14,6 @@ if [ ! -d "$PROJECT_DIR" ]; then
echo "Medusa project not found. Running installation..."
# Run the Medusa CLI generator silently with the desired options:
# --db-url: Uses the provided DATABASE_URL to connect and run migrations.
# --no-browser: Skip opening the admin dashboard.
# --directory-path: Specify where to install the project.
# --with-nextjs-starter: Optionally install the Next.js storefront.
npx create-medusa-app@latest my-medusa-app \
--db-url "$DATABASE_URL" \
--no-browser \
@ -35,6 +33,6 @@ cd "$PROJECT_DIR"
# List the contents of the project directory to verify installation.
ls -la
# Finally, start the Medusa server (development/production mode as desired).
# Finally, start the Medusa server.
echo "Starting Medusa server..."
exec npm start