diff --git a/Dockerfile b/Dockerfile index cce6e94..aaaa1b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,14 @@ -FROM node:20-alpine +FROM node:20-bullseye-slim -# Set working directory in the container. +# Install Git during the build phase using apt. +RUN apt-get update -y && apt-get install -y git && rm -rf /var/lib/apt/lists/* + +# Set working directory. WORKDIR /app -# Copy the entrypoint script into /app and make it executable. +# Copy your entrypoint script. COPY entrypoint.sh /app/entrypoint.sh RUN chmod +x /app/entrypoint.sh -# (Optional) You might also want to copy other files that your Medusa app may need, -# but in this case, the project is created during runtime and stored in a persistent volume. - -# Set the default command to run the entrypoint script. +# Set the default command. CMD ["/app/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh index e308237..bccc570 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -3,8 +3,6 @@ set -ex 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,6 +10,7 @@ PROJECT_DIR="/app/my-medusa-app" # Check if the Medusa project has already been created. if [ ! -d "$PROJECT_DIR" ]; then echo "Medusa project not found. Running installation..." + echo "Git version: $(git --version)" # Run the Medusa CLI generator silently with the desired options: npx create-medusa-app@latest my-medusa-app \